The stock market offers few certainties, with one exception: Change.

Over time, innovation, competitive advantages, acquisitions, legal judgments, and a host of other factors, are responsible for reshuffling Wall Street's leaderboard. In other words, today's largest companies should look vastly different come 10 or 20 years from now.

For example, General Electric, Cisco Systems, Lucent Technologies, and Nokia, the latter of which would go on to acquire Alcatel-Lucent in 2015, were all among the 10 most-valuable publicly traded companies in 1999.  Some 23 years later, GE has dropped to No. 127, Cisco has fallen to No. 44, Lucent isn't even a publicly traded company anymore, and Nokia has plunged all the way to No. 391.

The same fate could await many of today's largest companies -- even tech giant Microsoft (MSFT 1.46%).

A superimposed clock and digital ticker board next to stacks of coins set atop cash bills.

Image source: Getty Images.

Microsoft has been a fixture as one of the world's largest companies

For the moment, Microsoft is the second-largest publicly traded company in the U.S. ($2.1 trillion market cap). It's also the only stock from the 1999 list to still retain a position among the 10 most-valuable companies today.

One of the reasons Microsoft has been such a success is its legacy operations. For instance, Windows is no longer the growth segment it was for the company during the 1990s and 2000s. Nevertheless, Windows accounts for more than 76% of global desktop operating system market share.  The high margins associated with selling software on PCs generates abundant cash flow that Microsoft can funnel into high-margin initiatives and/or acquisitions.

In particular, Microsoft has used its incredible cash flow and rock-solid balance sheet -- Microsoft is one of only two publicly traded companies to sport the highly coveted AAA credit rating from Standard & Poor's, a division of S&P Global -- to invest in the cloud. Microsoft Azure has grown into the world's No. 2 cloud infrastructure provider and sustained a constant-currency growth rate near 50%. 

These could be three of the world's largest stocks by 2040

But even great companies can lose their luster. Although Microsoft's cash flow, balance sheet, and cloud-service growth indicate it can still be a great long-term investment, other stocks have the innovative capacity to potentially top Microsoft's market cap. What follows is a prediction of three diverse stocks that could be worth more than Microsoft by 2040.

The logical choice: Amazon

The no-brainer choice to surpass Microsoft and become one of the largest companies in the world is e-commerce stock Amazon (AMZN 0.57%). As of Aug. 9, 2022, Amazon shares would need to gain around $700 billion in market value to eclipse Microsoft.

Most consumers are familiar with Amazon because of its absolutely dominant online marketplace. An eMarketer report from March 2022 projected that Amazon would account for just shy of 40% of all online retail sales in the U.S. this year.  To boot, the company sold more than 300 million items during its July 12-13 Prime Day event. It's a retail juggernaut that towers over its competition. 

Yet, it's not Amazon's highest revenue segment that can help it surpass Microsoft in market value. Rather, it's the ancillary operating segments and sales channels that are expected to deliver the bulk of its profit growth and cash flow.

For instance, Amazon's leading marketplace has helped it attract more than 200 million Prime members. At minimum, 200 million people paying the annual membership fee of $139 are bringing the company close to $28 billion in higher-margin annual sales. Subscription-service revenue should help Amazon grow its logistics network, undercut brick-and-mortar retailers on price, and funnel cash to other high-growth initiatives.

Arguably the top growth initiative for Amazon is its world-leading cloud infrastructure segment, Amazon Web Services (AWS). AWS accounted for 33% of global cloud-service spending in the first quarter, and has been responsible for the lion's share of Amazon's operating income, despite accounting for only 15% to 16% of the company's net sales.  Even if Amazon's retail sales were to stagnate, growth in AWS and other high-margin segments could propel the company's cash flow many multiples higher.

If investors are willing to pay 30 times annual cash flow for Amazon -- this is the median year-end premium investors paid for Amazon throughout the 2010s -- its market cap could surpass $4.2 trillion by the end of 2025.

Two college students sharing a laptop.

Image source: Getty Images.

If everything went just right: Meta Platforms

A second stock with the innovative capacity to leapfrog Microsoft, assuming a number of things went right, is social media stock Meta Platforms (META 2.59%).

To see Meta's name on this list might be shocking considering how poorly it's performed in 2022. Shares of the company have lost over half their value as historically high inflation and back-to-back quarters of U.S. gross domestic product (GDP) contraction weigh on advertising revenue. However, a momentary hiccup in the U.S. economy shouldn't scare away patient investors.

Meta is a behemoth in the social media space. Facebook, Instagram, WhatsApp, and Facebook Messenger, which are all owned by Meta, are consistently among the most-downloaded apps domestically and internationally. During the second quarter, the company recognized 3.65 billion monthly active users across its family of apps.  Considering that most of these users are adults, it means Meta is attracting over half the world's adult population to its sites at least once a month. With this sort of visibility, it's no wonder Meta Platforms is able to command such impressive pricing power.

Advertising is a cyclical industry, which means economic downturns hurt ad spending. However, the U.S. and global economy spend a disproportionately long amount of time expanding. This means Meta's ad revenue and pricing power should easily climb over time.

The real wildcard for Meta is the company's metaverse ambitions. The "metaverse" being the next iteration of the internet that allows connected users to interact with each other and their environment in a 3D virtual world. It's going to be years before the infrastructure is in place to support the metaverse. But when it is in place, Meta has an opportunity to be a leading on-ramp to this potentially $30 trillion opportunity. If all goes right, it very well could surpass Microsoft.

The longshot: PayPal Holdings

The longshot to eventually put Microsoft in the rearview mirror by 2040 is fintech stock PayPal Holdings (PYPL 1.81%). PayPal has a $114 billion market cap, so it has quite a bit of ground it'll need to gain on Microsoft over the coming 18 years.

Although digital payments have been around for more than a decade, growth remains in the very early stages. A report from The Insight Partners forecast global digital payment growth of 15.4% per year between 2021 and 2028.  With few exceptions, PayPal has been completely trouncing this growth projection.

For example, PayPal managed to grow the total payment volume (TPV) on its network by 13% on a constant-currency basis during the second quarter.  As noted, U.S. GDP has retraced in back-to-back quarters, which many investors would label as a "technical recession." If PayPal can maintain double-digit TPV growth with historically high inflation pulverizing the lowest decile of earners and the U.S. economy clearly weakening, consider how quickly it can grow during long-winded periods of economic expansion.

As I've previously pointed out, PayPal's greatest attribute might be its user engagement. When 2020 came to a close, active accounts averaged 40.9 transactions over the trailing-12-month (ttm) period. As of June 30, 2022, active accounts averaged 48.7 transactions over the ttm. Even with economic weakness plainly evident, digital users are more engaged with PayPal's platforms than ever before. Since this is predominantly a fee-based company, more engagement should yield steadily higher profits.

Acquisitions could play a key role in PayPal's future as well. The company purchased Japan's buy now, pay later (BNPL) service Paidy last year to give consumers more payment flexibility. Additional acquisitions in the e-commerce or BNPL space shouldn't be ruled out, and could be pivotal to PayPal's (possible) ascension to one of the world's largest companies by 2040.