A lot of it is timing, but for many there is the absolute long term application of time. Read the book "Outliers". It talks about how people like Bill Gates managed to do what they did. Did you know that Bill Gates was a hacker? That he pulled very late nights (sometimes sleepless) computing away for hours on end? He developed a savvy understanding of programming, but only because it was facilitated for him (his local school got special funding to get a computer system with a teletype terminal, instead of a punch card interface).
Facebook was a lottery win for Mark Zuckerberg. He wasn't doing anything particularly innovative from a technology standpoint. However, he simply took someone else's idea and improved upon it, making the user interface very easy to use. He also had the luck of timing to be able to get his social networking website very popular on campus. From there, it started to take off and then he realized it had major potential. How it went from there was all about brand building. A great idea won't go anywhere without the right marketing and timing. He was fortunate enough to hook up with the right people to make that happen. AND... he was lucky enough to get his "idea theft lawsuit" settled out of court. Frankly, it could have gone in a very different direction and he could have lost the whole thing. Right idea, right timing, right supportive environment, and major obstacles sidestepped. That's what it takes.