Between 2019 and 2021, the S&P 500 did something it hadn't done in over 20 years and may never do again: It doubled. For reference, the only three-year time periods the S&P 500 had a higher total return were between 1995 and 1997, 1996 to 1998, and 1997 to 1999, when it produced a total return of 126%, 111%, and 108%, respectively. 

Coming close to a record is one thing. Doing it during a period that was mainly spent in a global pandemic is quite another. The average long-term annual return in the S&P 500 is around 8%. Doubling your money by historical averages would take roughly nine years. So the three-period we just witnessed is truly remarkable.

Here are some catalysts that helped the stock market make history, as well as why it could be challenging to match this performance going forward. 

Dissecting the S&P 500

The S&P 500 is almost unrecognizable from what it was just a few decades ago. Today, the top seven largest components are tech stocks, and the top 10 largest holdings make up 29% of the index. In 1999, the top five largest stocks by market cap were Microsoft (MSFT -0.16%), General Electric, Cisco Systems, Walmart, and ExxonMobil.

Most of today's tech giants performed just fine throughout the pandemic. In fact, many of their businesses enjoyed record performances. Here's a look at the recent three-year total return of the S&P 500, the Nasdaq Composite, Nasdaq-100 index, the Dow Jones Industrial Average, and the seven largest U.S. stocks by market cap.

^SPXTR Chart

^SPXTR data by YCharts

Notice that all seven stocks beat the S&P 500, and all but Amazon outperformed the Nasdaq. Such strong performances from the heaviest weighted stocks in the index mean that dozens if not hundreds of smaller companies can post rather lackluster performances and the S&P 500 can still do extremely well.

Apple (AAPL -0.07%) and Microsoft have single-handedly added nearly $4 trillion in market cap to the S&P 500 in the last three years. For reference, the total market cap of the S&P 500 at the end of 2018 was $21.03 trillion, meaning that just two companies alone would have given the index a 19% return in three years.

Timing and low interest rates

By Sept. 30, 2018, the S&P 500 was up 9% for the year. By Dec. 31 2018, it finished the year down over 6%.

Such a sizable correction in such a short period of time was mostly due to the U.S.-China trade war. The largest geopolitical risk at the time, tensions were mounting into the end of the year, and no one really knew how newly appointed U.S. Federal Reserve chair Jerome Powell would respond.

In the three years since then, both the Federal Reserve and the federal government have kept interest rates extremely low and bolstered the economy through heightened spending and stimulus. Without that support, it is unclear how the U.S. stock market would have performed.

Low interest rates and support give companies the precious dry powder needed to weather a storm. They also lead to lower mortgage interest rates, which encourage homebuying and consumer spending that stimulates the economy. Consider that the 10-year Treasury yield was above 3% to start December 2018, fell below 2% by the end of 2019, fell below 1% by March 2020, and finished 2021 at just 1.5%. Given the success the U.S. economy has enjoyed, as measured by consumer spending, low unemployment, and the record-high U.S, stock market, we could very well see interest rates remain low for the foreseeable future.

In sum, low market returns in 2018 were largely made up in early 2019 after the Fed shifted its tune, which helped contribute to the S&P 500's 29% gain in 2019. Favorable federal and monetary policy helped the S&P 500 gain 16% in 2020. And in 2021, continued federal support, low interest rates, a healthy job market, and massive growth in the largest sector of the U.S. economy (technology) propelled the S&P 500 to gain 27% in 2021. 

Where do we go from here?

The factors that helped the market double in three years were unique. This isn't to say it couldn't happen again -- it's just worth curbing your enthusiasm in the years to come. Large tech stocks can only outperform for so long. And eventually, other sectors of the economy will have to pick up the slack. Given the valuations and growth rates of those other sectors, it's a lot to ask the largest industrial stocks, consumer goods stocks, or healthcare stocks to triple or more in a three-year time frame.

The S&P 500's performance over the last three years is intriguing and can even feel a little bit crazy. The most important thing is to invest in companies you understand in a way that suits your risk tolerance and helps you hit your long-term financial goals. Starting with $0 and saving $500 a month for 35 years at an 8% annual return will give you over $1 million. 

Don't get me wrong -- market outperformance and big gains feel amazing. But patience and discipline are all you really need if you want to be rich.