History can be an amazing teacher on Wall Street for those willing to listen. Although what happened in the past doesn't often repeat to a "t" in the future, things do have a way of rhyming for the stock market.

While nothing comes with a guarantee when investing, data from Crestmont Research shows that every rolling 20-year period for the benchmark S&P 500 when back-tested to 1900 has generated a positive total return, including dividends. This is another way of saying that if an investor had, hypothetically, purchased an S&P 500-tracking index at any point between 1900 and 2005 and simply held for 20 years, they'd have made money every single time!

History can also be a helpful guide when it comes to Wall Street's leading businesses. Just 10 public companies traded on U.S. exchanges have ever joined the trillion-dollar club, including all members of the "Magnificent Seven," Berkshire Hathaway, Broadcom, and Taiwan Semiconductor Manufacturing.

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

Image source: Getty Images.

Based solely on what history tells us, one of these trillion-dollar stocks, which has been powered higher by the artificial intelligence (AI) revolution, is treading in dangerous territory. At the same time, another trillion-dollar AI stock makes for nothing short of a no-brainer buy.

History suggests Wall Street's AI darling, Nvidia, may be in big trouble

Since 2023 began, few stocks have been hotter than Nvidia (NVDA 1.15%). Shares of the company have rallied nearly 1,200%, with its market cap climbing by almost $4.2 trillion.

Nvidia's path to becoming the world's largest publicly traded company has everything to do with its graphics processing units (GPUs). Its Hopper (H100), Blackwell, and Blackwell Ultra AI-GPUs serve as the brains that fuel split-second decision-making in enterprise AI-accelerated data centers, as well as the training of large language models (LLM). With demand for AI-GPUs outpacing their supply by a substantial sum, Nvidia has had little trouble netting $40,000 or more for each of its high-powered chips.

Nvidia's CUDA software platform has also played a role as its unsung hero. This is the toolkit developers are using to maximize the compute potential of their GPUs, as well as to build and train LLMs. Without CUDA, Nvidia might have a hard time keeping developers contained within its ecosystem of products and services.

With a sky-high addressable market for artificial intelligence infrastructure and a seemingly impenetrable moat as the preferred supplier of AI-GPUs, Nvidia stock would appear to be a phenomenal investment. But looks can be deceiving, based on what history tells us.

For more than 30 years, every game-changing advancement and technological innovation has eventually navigated its way through a bubble-bursting event. The internet, genome decoding, nanotechnology, 3D printing, blockchain technology, and the metaverse are just some of the examples of initially hyped technologies that eventually endured a bubble-bursting event.

Although it's possible AI could be the exception to this unwritten rule, it's unlikely. Most companies haven't yet optimized their AI solutions, nor are many generating a positive return on their AI investments. This echoes what was witnessed prior to the bursting of previous next-big-thing technologies. If an AI bubble were to form and burst, few companies would feel the pain more than Nvidia.

History also tells us that competition in next-big-thing investments is inevitable. While most investors are focusing on external GPU developers, Nvidia's biggest threat is likely to come from its own top customers by net sales. Most Mag-7 members are internally developing their own AI chips to use in their data centers. Even though these chips are slower than Nvidia's AI-GPUs, they're markedly cheaper and will lessen the GPU scarcity that's helped prop up Nvidia's pricing power and gross margin.

The icing on the cake is that history warns of Nvidia's unsustainably high price-to-sales (P/S) ratio. Megacap companies on the leading edge of a technological advancements have historically topped out at P/S ratios of 30 to 40. Nvidia has spent much of the last two years vacillating between a P/S ratio of 25 and 42.

A businessperson typing on a laptop while seated in a cafe.

Image source: Getty Images.

History makes clear that this trillion-dollar club member remains a smart buy

Though next-big-thing investments have a checkered past, and artificial intelligence has been a boon for all members of the Magnificent Seven, history gives a relatively clean bill of health to social media colossus Meta Platforms (META 0.42%).

Let's not beat around the bush: Mark Zuckerberg's company is investing a boatload of money in AI data center infrastructure. This includes spending a pretty penny to purchase hardware from Nvidia. On the surface, this association would appear to be bad news if an AI bubble forms and bursts.

But AI represents a relatively nascent part of Meta's growth engine at the moment. Whereas Nvidia's data center segment accounts for nearly 90% of its total sales, Meta is bringing in almost 98% of its net revenue from advertising.

Its family of apps, which includes Facebook, Instagram, WhatsApp, Threads, and Facebook Messenger, among others, lured an average of 3.48 billion daily visitors in June. No other social media company comes close to this many daily eyeballs, which typically affords Meta Platforms exceptional ad-pricing power.

Meta is primarily using AI from an applications standpoint at the moment. It's giving businesses on its advertising platforms access to generative AI solutions in order to create and tailor static and video messages to specific users. These AI solutions are boosting Meta's pricing power and should result in improved click-through rates for businesses using its ad platform. If the AI bubble bursts, it's not going to have a material impact on the ability of businesses to employ these solutions to target users.

More importantly, ad-driven businesses benefit from the nonlinearity of economic cycles. Eight decades of history show the average U.S. recession has lasted just 10 months, with none surpassing 18 months in length. On the other hand, the typical economic expansion has endured for roughly five years, with two growth spurts topping the 10-year mark. Advertising tends to be notoriously cyclical, which means a company like Meta Platforms is going to be basking in the proverbial sun far more often than playing defense under gray clouds.

Meta's balance sheet is another catalyst that can give its share price a boost. Zuckerberg's company closed out June with north of $47 billion in cash, cash equivalents, and marketable securities, and is pacing more than $99 billion in cash generated from its operations this year. Meta has the luxury of spending aggressively on projects that won't pan out for years, from a revenue-generating standpoint, such as the metaverse.

The final piece of the puzzle is Meta's valuation. Its forward price-to-earnings (P/E) ratio of 24 is not too far above its average forward P/E over the trailing five-year period. If history rhymes, once again, Meta stock is well-positioned to benefit.