Coca-Cola (KO 0.31%) shares have become cheaper in 2023 even as the broader market surged. Investors can now purchase the beverage giant for close to the $60 per share it was trading at just before the pandemic struck markets in a big way in early 2020.

This weak stock price performance implies that Wall Street has low expectations around sales and earnings growth over the short term, especially if consumer spending slows toward a recession. But Coke might still deliver impressive returns over several years, regardless of what selling conditions characterize the next few quarters.

With that big picture in mind, here's why the stock looks great as a long-term buy right now.

Diverse portfolio

There wasn't much in Coke's latest earnings report to cause investors to worry about its sales trends. While peers like PepsiCo (PEP -0.41%) have relied solely on price increases to boost revenue, the beverage giant notched higher volume and prices through late March. These trends combined to push organic sales higher by a blistering 12%. "Our system alignment is stronger than ever," CEO James Quincey said in a late April press release.

That massive distribution and marketing network is allowing Coke to sell more of its core brands even as it branches out into more high-growth segments like coffees, sports drinks, and waters. Its huge global reach let the company offset softer volumes in some geographies with big gains elsewhere. This diversity should help protect investors' returns through whatever selling conditions develop in late 2023.

Cash and profits

Coke's profit margin reflects its pricing power, along with some unique competitive strengths. Operating income jumped 15% in the first quarter, after accounting for currency exchange rate shifts, as people continued spending in on-the-go consumption. This success translated into a slight increase in operating margin, up to 32% of sales from 31% of sales a year ago. PepsiCo, by comparison, turns about 13% of revenue into operating profit.

Chart showing Coca-Cola's operating margin beating PepsiCo's since 2014.

PEP Operating Margin (TTM) data by YCharts

Cash flow trends are similarly strong and help support a dividend that's been rising for 60 consecutive years. Coke paid $8 billion in dividends to shareholders last year and can easily pay a bit more this year. Management is targeting nearly $10 billion of free cash flow in 2023, after all.

The discount

Despite those positive operating and financial trends, Coca-Cola stock is priced at just 6 times annual sales, which is close to its lowest valuation since the initial weeks of the pandemic. Cautious investors might prefer PepsiCo here, as the snack and beverage giant is priced at below 3 times sales.

Yet Coke's premium valuation makes sense considering its much higher profitability, its larger sales footprint, and its opportunities to grow sales in niches like sparkling waters and energy drinks. Toss in a dividend that today yields over 3% annually, and you have the ingredients for excellent long-term returns.

It's always possible that Coke's stock will fall further in the coming months, but investors shouldn't let that potential scare them away from owning an excellent business. Coca-Cola will likely be generating much higher annual earnings in five or 10 years, and that's the factor that will power shareholder returns over time.