When you're ahead, you're further along or further forward. If you're ahead of all the other runners in a race, you're winning.
The team at the very front of a three-legged race is ahead, and the path that stretches in front of you as you walk through the woods is ahead of you. As well as signifying being physically first or in front, ahead can be used to talk about time: "She had her whole life ahead of her." The word was first used by sailors, to mean "in a forward direction."