Elon Musk and Peter Thiel would probably be languishing in obscurity if Paypal had not been sold off right at the edge of the dotcom bubble and given them a financial base to propel their future.
It is being at the right place, at the right time, with the right skill, finding the right investors/employees, partners and much more. When all of that aligns, you get a billionaire. It is only slightly less lucky than playing lottery.
PS: This does not apply to being a millionaire. You can be a millionaire by working hard, taking an upper middle class job and investing prudently.