Investing in an index fund that tracks the S&P 500 has proven to be a wonderful endeavor historically. For example, in just the past decade, the Vanguard S&P 500 ETF has climbed at an annualized pace of 12.9%, which includes dividends.

But some individual investors strive to outperform the broader index. To do this, it's critical to find companies that can put up strong investment returns. However, I think it's also important to ignore the ones that likely can't do this.

If your ultimate goal is to beat the S&P 500, you'll probably regret buying this top Warren Buffett stock.

Weak returns

Investors looking to outperform the index should avoid buying shares of Coca-Cola (KO -0.22%). As of this writing, Berkshire Hathaway owns 9.3% of the outstanding stock of the beverage giant, worth $25 billion.

Despite Coca-Cola having the Buffett-led conglomerate's vote of confidence, returns have been poor. In the past five- and 10-year periods, the stock has generated a total return of 43% and 106%, respectively. During the last decade, the S&P 500 put up a total return of 237%.

Of course, historical results won't necessarily resemble forward returns. But when talking about an established business like Coca-Cola, I think it's safe to assume that investors will continue to lose to the market in the years ahead.

Quenching the world's thirst

Coca-Cola clearly hasn't worked out to be a successful investment in the recent past. However, there are still reasons to believe it's a high-quality business.

For starters, this is one of the world's strongest brands, with a history that spans more than 100 years. By selling beloved beverages, like its flagship Coca-Cola soft drink, as well as Dasani water and Minute Maid juice, the business has certainly developed customer loyalty. This adds to its long-term durability and relevance.

The company's globally recognized brand helps it stand out among the competition. It also allows Coca-Cola to raise prices for its beverages. In the first quarter of fiscal 2024 (ended March 29), the business posted a 3% net revenue jump, driven mainly by higher prices. That's admirable, as it shows that Coca-Cola can handle inflationary headwinds.

Because of its strong brand that encourages customers to pay up, this business is extremely profitable. In the past decade, Coca-Cola's gross margin and operating margin have averaged a superb 60.5% and 26.4%, respectively.

Consistent profits have helped Coca-Cola raise its dividend for a jaw-dropping 62 straight years. With a current dividend yield of 3.1%, it's understandable if income-seeking investors are drawn to the stock.

Not a good setup for investors

As we've seen with Coca-Cola stock's trailing five-year underperformance, a strong brand and high profitability aren't enough to reward shareholders and their portfolios. And this is likely to be the case going forward, which is why investors should avoid buying shares if they want to beat the S&P 500.

Coca-Cola has limited growth prospects. Its 2023 revenue of $45.8 billion was actually lower than it was 10 years earlier in 2013. The worldwide soft drink market is extremely mature. In fact, this is an industry that expands about 3% to 5% per year, which is in line with global gross domestic product (GDP) growth. This doesn't provide a robust backdrop for Coca-Cola to meaningfully increase its sales base.

As if low growth potential wasn't enough of a deterrent, shares of Coca-Cola trade at a price-to-earnings (P/E) ratio of 25.1. This represents a slight discount to the trailing five-year average, but it's a premium to the S&P 500. Investors aren't being presented with an attractive setup here.

While it might seem like the smart move to automatically follow in Buffett's footsteps and own the same businesses that he does, especially one whose position is as large as this one's is, the average investor should be a bit more critical. That independent thinking will lead one to believe that Coca-Cola is a company that's best avoided.