Among S&P 500 components, few (if any) have had a better run over the trailing decade than electric-vehicle (EV) manufacturer Tesla (TSLA -1.11%). As of the closing bell on March 30, 2023, shares of Tesla had returned better than 7,600% over the trailing decade.

This amazing outperformance is a reflection of Tesla's first-mover advantages in the EV space. It's the first automaker in more than a half-century to have successfully built itself from the ground up to mass production. Last year, Tesla produced 1.37 million EVs and has its sights set on hitting 1.8 million EVs in 2023, largely thanks to the ramping up of production activity at the Berlin, Germany, and Austin, Texas, gigafactories, which both came online in 2022. 

Tesla's profitability has also played a key role in pushing its market cap to $624 billion (and over $1 trillion at one point). Based on generally accepted accounting principles (GAAP), Tesla has been profitable in each of the past three years.

An hourglass set next to messy stacks of coins, with a bright light source in the background.

Image source: Getty Images.

By 2040, these could be some of the world's largest companies

But if there's one constant when it comes to world's largest publicly traded companies, it's that they're constantly being shuffled up and down the list. If history serves as a guide, today's largest companies are liable to be replaced 10 to 20 years from now.

Between rapidly increasing competition in the EV space, Tesla struggling to become more than just a car company, and Elon Musk adding boatloads of extra risk by failing to fulfill a laundry list of promises, it's quite possible Tesla is leapfrogged by other businesses (in terms of market cap) in the future.

While no one knows precisely what the future holds, here's my prediction of three stocks that could be worth more than Tesla by 2040.

The logical choice: Meta Platforms

Based on companies currently trailing Tesla in market cap, the likeliest to surpass it is social media stock Meta Platforms (META 0.43%). Meta is the parent company of Facebook, the most-popular social media site on the planet.

Meta hasn't been without its issues. Fears of a U.S. or global recession have weighed on its stock for the past year. With more than 97% of its annual revenue derived from advertising, a recession is a definite short-term worry for its top and bottom line.

Furthermore, CEO Mark Zuckerberg has spent aggressively on a variety of metaverse initiatives. Even though the metaverse is unlikely to be a significant sales or growth driver for years to come, the losses from Meta's Reality Labs operating segment have ballooned. That's not a good look for Meta when investors are concerned about a bear market and possible U.S. recession.

However, these are very short-term concerns that have no impact on Meta's clear-cut competitive advantages. For instance, Facebook, Facebook Messenger, WhatsApp, and Instagram, are still among the four most-downloaded social media apps in the world. The fourth quarter saw Meta's family of apps attract 3.74 billion unique monthly active users.  With more than half the world's adult population visiting a Meta-owned asset each month, it's pretty clear the company possesses strong ad-pricing power more often than not.

Meta's incredible cash flow and balance sheet also affords it the ability to take chances and invest in things like the metaverse. The company closed out 2022 with $30.8 billion in net cash, cash equivalents, and marketable securities. Further, it generated $42.7 billion in operating income from its family of apps. Even if the metaverse lives up to only a fraction of its hype, Meta will be well-positioned with its hardware and infrastructure to be an on-ramp to the virtual world.

If everything went just right: Mastercard

A second stock that has a reasonable chance to leapfrog Tesla over the next 17 years is payment processor Mastercard (MA 0.07%). Just keep in mind that Mastercard would probably need a few things to go its way for that to happen.

The biggest issue (if you want to call it that) for Mastercard is that it's a cyclical company. Financial stocks tend to ebb and flow with the U.S. and global economy. If a U.S. recession were to take shape, it wouldn't be a surprise if consumer and enterprise spending slowed.

Another concern for Mastercard -- and where the company would need things to go just right -- is how cryptocurrencies and blockchain technology fit into the grand scheme of things. If blockchain continues to be more hype than reality in the payments space, Mastercard's leading role as a global payment processor should be secure.

Mastercard has a clear path to steady domestic growth. As of 2021, filings with the Securities and Exchange Commission showed it held close to 24% of credit card network purchase volume market share in the United States (the top market for consumption in the world). 

But a significant portion of Mastercard's long-term growth opportunity will come from emerging/developing markets. With more than half of the world's global transactions still being conducted in cash, Mastercard has plenty of runway to organically or acquisitively enter underbanked regions, such as the Middle East, Africa, and Southeast Asia.

Investors would also be wise to note that Mastercard has largely de-risked its operating model by avoiding lending. Financial institutions that lend normally contend with rising credit delinquencies and loan losses during recessions. Since Mastercard isn't a lender, it doesn't have to set aside capital to cover loan losses. This allows Mastercard to bounce back from recessions faster than most financial stocks.

A person holding their smartphone above a portable point-of-sale device to make a contactless payment at a cafe.

Image source: Getty Images.

The longshot: PayPal Holdings

The third stock that could be worth more than Tesla by 2040, but is the longest shot to surpass it based on its current market cap, is fintech stock PayPal Holdings (PYPL 2.90%). PayPal's $86 billion market cap would need to grow by more than 625% to hurdle Tesla (at its current valuation).

Although the growing likelihood of a U.S. recession is one reason PayPal's stock has retraced by 75% from its all-time high set in 2021, inflation has been the bigger concern. With inflation well above its historic average, the purchasing power of low-earning workers has been reduced. PayPal's digital platforms are usage-based, which means reduced purchasing power for users could lead to fewer transactions.

Yet in spite of these near-term worries, PayPal's key performance metrics continue moving in the right direction. Even with net new account growth slowing, PayPal's total payment volume (TPV) increased by a double-digit percentage, excluding currency movements, to $1.36 trillion in 2022.  When the U.S. economy is firing on all cylinders, it's not uncommon for PayPal's TPV to increase by 20% annually.

What's even more important for PayPal is the engagement it's seeing from its active users. At the end of 2020, PayPal's active users had completed an average of 40.1 transactions over the trailing-12-month (TTM) period. As of the end of 2022, this figure was up to 51.4 transactions over the TTM. More transactions completed on PayPal and Venmo is the easiest way for the company to grow its gross profit.

In addition to innovating in the fintech space, management is also being mindful of expenses and doing right by its shareholders. CEO Dan Schulman, who's set to retire at the end of this year, announced at least $1.3 billion in cost-savings for 2023 and introduced a $15 billion share buyback program last year.

With digital payments still in their infancy and PayPal leading the way, there's a reasonable chance it'll be worth more than Tesla by 2040.