For well over a century, The Coca-Cola Company (KO -0.19%) and Pepsico (PEP 0.29%) -- or the Pepsi-Cola Company as it was previously called -- have been locked in a struggle for carbonation supremacy. This struggle is sometimes called the Cola Wars. For 40 years, little has changed. That is, until now.

According to The Wall Street Journal, Dr Pepper -- from beverage company Keurig Dr Pepper (KDP -0.12%) -- has now pulled even with Pepsi for the second spot on the carbonated beverage charts. And if you adjust for enough decimal places, Dr Pepper is technically ahead by a hair.

Pepsi briefly took the top spot in the 1980s during Coca-Cola's New Coke fiasco, according to Beverage Digest. However, Pepsi fell back to second place and has stayed there for nearly 40 years. But Dr Pepper has steadily chipped away at Pepsi's lead.

According to Beverage Digest data analyzed by The Wall Street Journal, Pepsi had 13.5% market share compared to market share of just 6.3% for Dr Pepper as recently as the year 2000. But in 2023, both Pepsi and Dr Pepper enjoyed an 8.3% market share. For its part, Coca-Cola sits safely out in front with a 19.2% market share.

Here's what this means and doesn't mean for investors.

Why Keurig Dr Pepper stock is worth a look

Understand that when Dr Pepper is named the holder of second place, it refers to the brand's sales volume. However, Keurig Dr Pepper owns and licenses many brands besides Dr Pepper, including 7UP, Green Mountain Coffee, Canada Dry, Swiss Miss, and many more.

These brands give Keurig Dr Pepper a diverse portfolio across carbonated beverages and coffee. Today, Dr Pepper brand sales are growing as it takes market share. But tomorrow's growth could come from elsewhere in the portfolio -- that's why having a broad portfolio is a strength.

Over the last five years, Keurig Dr Pepper's earnings per share (EPS) have more than doubled. And the company has grown its dividend at a faster rate than many of its peers. However, its price-to-earnings (P/E) valuation has been cut in half, meaning the stock has gone sideways.

KDP EPS Diluted (TTM) Chart

KDP EPS Diluted (TTM) data by YCharts

The good news for investors today is that Keurig Dr Pepper stock is cheaper now than it was five years ago and the dividend yield is almost as high as it's ever been at 2.5%. Moreover, the company is still growing at a modest pace, which provides an opportunity for future earnings growth and rewarding shareholders.

Why Pepsi stock is worth holding

Just as Keurig Dr Pepper has a strong portfolio of brands, so too does Pepsi. In fact, while the Pepsi brand has slipped to third place among carbonated beverages, the company still owns two more beverages in the top nine -- Mountain Dew and Diet Pepsi.

Keurig Dr Pepper stock might be a better deal than Pepsi stock today. That said, Pepsi might have the stronger business because it doesn't only have a portfolio of beverages, it also has a portfolio of snacks. And the snack portfolio is a major contributor to profits.

In the first quarter of 2024, Frito-Lay North America accounted for 57% of Pepsi's operating profit. The company doesn't break out snack sales in international markets. But accounting for those international sales elevates Pepsi's snacking profits even more.

Pepsi might have slipped to third place when it comes to carbonated beverages, and Dr Pepper fans should rightly take a victory lap. However, Pepsi's shareholders shouldn't panic because the business is still strong, thanks to its product diversity.

Moreover, Pepsi is still growing its profits, thanks to particular strength in international markets.

What it all means

Dr Pepper's second-place finish in 2023 is a fun headline. However, in isolation, it doesn't constitute a good reason to buy Keurig Dr Pepper stock. Those who buy today need to believe that the company can grow its portfolio both domestically and internationally. And they should believe that the company can continue growing profits and increasing what it gives back to shareholders.

For what it's worth, I believe those are reasonable assumptions.

I also believe it's reasonable for Pepsi investors to continue holding their shares. Yes, Pepsi itself is technically in third place now. But this isn't a business in decline. It's one of the biggest and most important consumer companies in the world, and it can continue with good shareholder returns over the long haul.