If you had invested in either Apple or Microsoft at the time of its initial public offering, or IPO, your gamble would have paid off big time. But one of these tech heavyweights would have earned you significantly more than the other. A $1,000 investment in Apple on the day of its IPO on December 12, 1980, would be worth more than $425,000 today, according to CNBC calculations. However, a $1,000 investment in Microsoft on the day of its IPO on March 13, 1986, would be worth more than $1.7 million, or around four times more. Those figures include price appreciation and dividends. Returns also account for stock splits and other corporate events. While both Apple and Microsoft stock have performed well, any individual stock can over- or under-perform and past returns do not predict future results.

For decades, Microsoft dominated the tech industry

Microsoft dominated the tech industry throughout the 80s and 90s and was successful long before 1986. Although Microsoft was founded in 1975, the company waited 11 years before going public, primarily because CEO and co-founder Bill Gates wanted to retain as much control of the company as possible. It helped that Microsoft was so profitable that it didn't need outside money in order to grow. The eventual IPO was an immediate success. It opened at a price of $21 per share, but "the first trade took place at $25.50 a share, an indication of the fierce demand for the stock," the Seattle Post-Intelligencer reported at the time.

Nadella embraced cloud computing and helped Microsoft emerge as a top competitor in the space. He also helped the company expand its reach through the acquisitions of professional networking site LinkedIn in 2016 and code-sharing service GitHub in 2018. Since Nadella took over, Microsoft's share price has nearly tripled. In November, it dethroned Apple as the most valuable public company in the world, with a market cap of more than $850 billion. If Microsoft holds onto the spot through the end of the year, it will mark the first time since 2002 that the company closes out in the top position.

Apple fumbled, then emerged as a fierce competitor