The S&P 500 (^GSPC -0.53%) was a surefire winner for investors over the past two years -- it roared higher through a bull market, advancing 24% and 23%, respectively, in 2023 and 2024. But in recent months, the benchmark's performance soured, and the S&P 500 even briefly entered bear territory back in April.

The reason for such a turnaround after two strong years: Investors worried that President Donald Trump's plan to roll out tariffs on imports could result in a surge in prices -- and that could weigh on companies' costs and the consumer. As a result, corporate earnings and the general economy might suffer.

Such a slowdown would represent bad news for high-growth companies that led last year's market gains -- like artificial intelligence (AI) giants Nvidia and Palantir Technologies. Growth players rely on consumer and corporate spending as well as favorable borrowing conditions to expand, so any signs of economic weakness hurt demand for their shares.

All this dragged down the S&P 500, which fell as much as 15% from the start of the year through its low point in April. But I see any low points for the S&P 500 and many of its top-quality stocks as a buying opportunity -- and even buying the index at a high may deliver fantastic returns over time. Let's zoom in and consider why this index still looks like a smart bet.

An investor smiles while working on a laptop.

Image source: Getty Images.

A long-term view

So first, it's important to note that since its low, the S&P 500 has rebounded on positive news such as an initial trade deal between the U.S. and China and strong capital spending forecasts from tech market giants, including Meta Platforms and Alphabet. This is great near-term news, allowing the index to gather some momentum, but when considering an investment in the S&P 500, it's key to take a long-term view.

The reason for this is twofold. First, in general, investing over a period of at least five years is more likely to result in a win than buying and selling an asset within a few days or weeks. It's very difficult to time the market and get in at a low point and exit at one of the highest points. It's much easier to buy shares of a company, for example, when that player looks well positioned to excel over time -- and then hold on to the stock as the company grows and meets certain milestones.

Data supports the idea of long-term investing, too: A look at the S&P 500 over time shows only 6% of 10-year investing periods resulted in negative outcomes, according to Capital Group. That's compared to 27% for one-year investing periods.

Second -- and this is a big reason why the S&P 500 still looks like a smart bet -- the index has shown itself to be a solid long-term investment. Since its launch as a 500-company index in the late 1950s, the S&P 500 has delivered an annual average return of 10%. So history suggests an investment in the index today, if held for a number of years, is very likely to result in a win for you.

The secret of the S&P 500's success

Now, let's talk about why the index has been so successful. It's simple: The S&P 500 tracks the performances of the biggest companies driving the day's economy -- since this benchmark regularly admits and deletes members, if you're invested in it, you're guaranteed exposure to the most relevant companies of the time.

So, your next question may be: What's the best way to invest in the S&P 500? And that's through buying a fund that tracks the index, such as the Vanguard S&P 500 ETF (VOO -0.47%). You can pick up shares of this exchange-traded fund (ETF) as you would a stock, since it trades daily on the market, and its expense ratio of 0.03% means costs won't chip away at your returns over time.

The Vanguard S&P 500 ETF, and other similar S&P 500 funds, mimic the composition of the index, and as a result, they mimic its performance too. Today, technology stocks are the most heavily weighted, representing 30% of the fund and the index, and Apple, Microsoft, and Nvidia are the three biggest holdings. But the fund also includes 10 other industries, ensuring diversification.

So, by investing in such an asset, you can easily place a bet on the S&P 500 -- and hold on for the long term to benefit from the development and growth of the country's best companies across industries.