There is a surprising amount of luck involved. More than you suspected.
> being successful at building paypal
Musk never worked for a company called PayPal. The predecessor companies that merged to become PayPal forced Musk out around the time of the merger. Later the company changed its name to PayPal and when it went public, Musk had a big payday.
Musk was the CEO of the merged company for a few months, before being fired for incompetence by the board. Afterward, they renamed themselves "paypal." Musk was rich enough to not have to sell his shares until the IPO, so he made a big payday.
I think of Elon Musk as being that guy who goes on a winning streak playing "double or nothing" coin flips. Enough people are doing it in Silicon Valley that one of them was going to hit a run of several heads, and get rich.
> being successful at building paypal
Musk never worked for a company called PayPal. The predecessor companies that merged to become PayPal forced Musk out around the time of the merger. Later the company changed its name to PayPal and when it went public, Musk had a big payday.