On July 17, PepsiCo (PEP 3.13%) stock had its best single session in over five years -- gaining 7.5% after the company reported second-quarter 2025 earnings. It was a sigh of relief for long-term investors who have endured an extended period of underperformance.

Even after the rally, Pepsi is still down year to date, and the stock is up a little over 6% in the last five years compared to a whopping 95% return in the S&P 500 (SNPINDEX: ^GSPC). However, those gains don't factor in Pepsi's sizable dividend, which yields 4%. Pepsi has raised its payout for 53 consecutive years, earning it a coveted spot on the list of companies that have raised their dividends for at least 50 years -- known as Dividend Kings.

Here are some key takeaways from Pepsi's latest earnings, highlighting why the dividend stock remains a compelling buy for investors seeking to boost their passive income.

Plants sprout from stacks of coins that are lined up in increasingly taller towers.

Image source: Getty Images.

The worst may be over for Pepsi

When Pepsi reported its first-quarter 2025 results in April, the beverage and snack giant slashed its full-year guidance due to revenue and earnings declines. The company cited inflation pressures, consumer demand challenges, geopolitical uncertainties, and tariff headaches.

A lot was going wrong for Pepsi, but its latest quarter showed that the company is heading in the right direction.

In the second quarter, Pepsi benefited from a weaker U.S. dollar, which improved its foreign exchange. A weaker dollar means that revenue generated in foreign currency goes further when Pepsi reports those results in dollars. Pepsi also saw volume declines level off, with convenient foods volumes down 2% and flat beverage volumes. In addition to its flagship Pepsi brand, the company owns beverage brands like Mountain Dew, Gatorade, Tropicana, and Aquafina. It also owns snack giant Frito-Lay (Lay's, Cheetos, Doritos, Fritos, etc.) and Quaker Oats. Pepsi has been acquiring a variety of snack brands to diversify its lineup and appeal to health-conscious consumers.

All told, the favorable foreign exchange, paired with decent performance throughout the business, gave Pepsi the confidence to confirm its full-year guidance for low-single-digit organic growth and flat earnings. It's not great, but it's a step in the right direction for a company that had been experiencing negative growth.

Pepsi is revamping its product lineup

Pepsi is doing a good job of focusing on what it can control by investing in top brands through marketing efforts and adjusting packaging sizes to give customers more options at a lower cost. On its second-quarter earnings call, Pepsi discussed international cost-cutting efforts, such as closing two plants to better align production with demand, reducing fixed costs, investing in its enterprise resource planning system, managing travel and expenses, revisiting third-party contracts, and boosting productivity.

Another big change for Pepsi is shifting its beverage and snack lineup to align with measures by the U.S. Department of Health and Human Services and U.S. Food and Drug Administration to phase out synthetic dyes. Reports indicate that Coca-Cola has agreed to use cane sugar instead of high-fructose corn syrup. So there's an industrywide effort to overhaul supply chains to include better ingredients.

Pepsi's recent acquisitions, such as Siete Foods, play into the push toward healthier snacks. Pepsi-owned SunChips use multigrain. And PopCorners are baked instead of fried. The company already has some brands that are aligned with the current administration's initiative. But its blockbuster snack brands are not.

That's about to change with the relaunch of Frito-Lay's Simply lineup, which removes artificial ingredients. Pepsi is relaunching Lay's and Tostitos under the Simply lineup in the fourth quarter or first quarter of next year and exploring the relaunch of Doritos, Cheetos, and Ruffles. The move showcases Pepsi's commitment to investing in its top brands and willingness to clean up its lineup to adhere to changes in consumer preferences and regulatory pressures.

Pepsi is noticeably discounted from its historical valuation

Pepsi can't control the business cycle or trade policy, but it is taking steps to lower costs and make investments that should help the company in the long run. In the meantime, the stock sports a juicy 4% yield and the valuation is incredibly cheap.

As mentioned, Pepsi's full-year guidance calls for flat earnings per share (EPS) growth. Last year, it earned $8.16 in core EPS. Based on its stock price as of market close on July 18 of $143.24 per share, Pepsi would have a price-to-earnings ratio of 17.6 if it hits its full-year goal. That's dirt cheap for what has historically been a premium-priced Dividend King.

Over the last decade, Pepsi has a median P/E of 26.2 -- so the stock tends to command a relatively expensive valuation. To be fair, Pepsi isn't at the top of its game like it was a few years ago, so it deserves to trade at a discount. But not as steep as what we are seeing in today's market.

A passive income powerhouse to buy now

Pepsi's second quarter was a reminder of the importance of investor sentiment and narratives in driving stock prices. Pepsi's latest results were mediocre at best, but the stock was so beaten down that OK was more than good enough.

A stock's price can get separated from fundamentals (to the upside and the downside) due to changes in sentiment. With the dust settled, I'd argue that Pepsi is still undervalued given its portfolio of top brands across food and beverage categories.

Some investors may prefer to wait to buy Pepsi until the company shows more convincing evidence of a return to growth. But in the meantime, the valuation is dirt cheap and the yield is high.

Value investors looking for passive income may want to scoop up shares of the Dividend King and get paid to wait for the company to overcome its challenges.