The stock market has spent most of 2025 defying both gravity and logic. Despite persistent geopolitical tensions in Europe and the Middle East, new tariffs, and unease over the timing of the Federal Reserve's policy decisions, the S&P 500 is up roughly 13% year to date as of this writing (Oct. 13). Yet this headline figure hardly captures the full drama beneath the surface.

The year began with roaring optimism, fueled by accelerating investment in artificial intelligence (AI). But the rally hit turbulence in April when President Trump announced his "Liberation Day" tariffs, a move that briefly shook Wall Street's confidence and sent retail investors scrambling. Since bottoming in mid-April, however, the S&P 500 has surged more than 20% -- a powerful rebound that has reignited the bull market.

^SPX Chart

^SPX data by YCharts

If current momentum holds through the end of the year, 2025 would mark a third consecutive year of double-digit gains. Such a streak is exceedingly rare. Over the past century, the index has posted back-to-back annual gains of 20% or more in only four distinct eras: the 1920s, 1930s, 1950s, and 1990s. Each of those periods created enormous wealth -- but also painful lessons -- reminding investors that history's verdict on sustained rallies is anything but clear.

History's echo: Four decades, four outcomes

The 1920s marked America's first great consumption boom, fueled by rapid industrialization, easy credit, and a cultural embrace of modernity. The markets soared alongside confidence in this seemingly endless prosperity. But as euphoria turned to speculation, valuations detached from reality and the crash of 1929 swiftly eroded a decade's worth of optimism, ushering in the Great Depression.

The 1930s told a very different story. Between 1935 and 1936, the S&P 500 surged a cumulative 69% -- only to plunge 38% the following year before rebounding 25% in 1938. These pronounced swings reflected an era defined by economic despair, during which bouts of optimism often gave way to renewed fear. While investors periodically wagered on recovery, these rallies were fragile and fleeting. In essence, it was a decade hallmarked more by volatility than victory.

The 1950s, by contrast, delivered genuine and sustained prosperity. In 1954 and 1955, the S&P 500 gained 45% and 26%, respectively. Unlike prior booms, this post-World War II expansion wasn't driven by speculation but rather by the rise of a middle-class economy and peacetime stability.

Then came the 1990s, an era that bears striking resemblance to today's AI-driven market. The internet revolutionized commerce, communication, and culture, propelling stocks into a new stratosphere. Yet this exuberance eventually created the dot-com bubble, whose burst in 2000 erased trillions in paper wealth overnight.

Traders at stock exchange look confused.

Image source: Getty Images.

Are we in a bubble or a generational breakthrough?

The current market rally sits at the crossroads of history's familiar patterns. On the one hand, the AI revolution has become this generation's defining investment theme. Semiconductors, data centers, cloud computing, and even nuclear energy stocks have led the charge, transforming balance sheets and investor expectations along the way.

Skeptics are warning that valuations have grown frothy, arguing that AI hype may be destined to repeat the exaggerations of 1999. But calling today's market a bubble discounts an important nuance: AI isn't a passing trend. Rather, it could be the beginning of a structural shift with enduring economic consequences -- more akin to the advent of electricity or the internet than to a momentary, narrative-driven frenzy.

This reality makes the path forward virtually impossible to predict. The market could very well cool off as earnings growth catches up to lofty investor expectations. Or it could kick into a new gear if AI's productivity gains begin to meaningfully lift global output.

Either way, this cycle embodies a familiar mix of genuine innovation sprinkled with speculative excitement -- a combination that has defined every great era of progress in market history.

The one investing lesson that history always confirms

Trying to predict when the market will surge or stumble is an exercise in false precision. A more reliable approach is to own quality businesses led by capable management teams, hold them through periods of volatility, and steadily add to your winners while trimming your laggards.

While history does not provide a precise strategy, there is one lesson that is remarkably clear: The S&P 500 rewards patience. The market has endured wars, recessions, bubbles, and crashes. Yet over the long run, the S&P 500 has delivered compound annual gains of about 7% after adjusting for inflation.

^SPX Chart

^SPX data by YCharts

The stock market can lose its way for years at a time, but it always finds its direction again. Across a century of panics, policy shifts, and economic upheavals, one truth has persisted -- resilience has been the market's defining attribute.