"top software engineer" strikes me as "top dog". Not necessarily someone able to pound you into the ground in a competition, but the person who employs that person and can keep him employed there.
So "top software engineer" today might be somebody like Larry and Sergei, or Zuck.
All top software engineers today got there primarily by luck. They were born into the right circumstances, able to coalesce the right network, and able to bet big on the right technology at the right time. Hard work no doubt played a role, but I bet nobody at the top of the mountain worked as hard as a lot of fast-food workers do.
So, one word answer: luck.