On the surface, PepsiCo's (PEP -2.97%) earnings weren't all that great. The beverage and snacks giant posted fairly tepid results, which seemed to only justify concerns about the drop in soda consumption in the United States.

Worries over the changing of consumer preferences away from soda flared when close rival Coca-Cola (KO 0.15%) reported its own quarterly earnings a few days prior. Shares of Coca-Cola sank 3% after the company reported earnings.

But PepsiCo's shares had a different reaction. The stock actually performed well on the day of earnings, even though the headline numbers were hardly impressive.

Here's why PepsiCo behaved much differently than Coca-Cola after reporting earnings.

Food beats beverages
In all, PepsiCo's organic revenue increased 3%. Earnings-per-share growth clocked in at 9% excluding currency effects and a one-time gain realized in the comparable period. This is satisfactory enough, especially considering Coca-Cola didn't have great things to say in its own report.

Coca-Cola produced net revenue growth of 3%, like PepsiCo, after stripping out currency fluctuations. On this basis, earnings per share increased 6%.

As you can see, Coca-Cola's results were essentially in line with PepsiCo's. But both stocks reacted much differently after the companies reported.

One of the reasons has to do with the fact that soda volumes are declining in mature markets like the United States, where Coca-Cola's case volume growth was flat once again. This has Coca-Cola investors worried, and rightly so, since sparkling beverages make up the vast majority of the company's revenue. PepsiCo at least managed to eke out a 0.5% increase in volumes in its Americas beverage segment.

More broadly, PepsiCo is basically evenly split between food and beverages. It too is seeing case shipments of its flagship soda level off in the U.S., but it's navigating the environment much better because its food business is doing relatively well. PepsiCo's foods business in the Americas produced 4% organic revenue growth and 6% operating profit growth last quarter.

The diversity of PepsiCo's business model allows it to post better numbers since it's not being weighed down by poor performance in domestic beverages. To combat this, Coca-Cola is turning to the emerging markets as its major growth opportunity. This is a good strategy and definitely one that the company must take. But it doesn't change the fact that soda consumption in the United States is in trouble.

Plus, PepsiCo is also growing in the emerging markets, and even there its food business is doing better than beverages. In its Asia, Middle East, and Africa segment, PepsiCo realized 7% volume growth in snacks and just 2% volume growth in beverages.

While Europe was a bright spot for Coca-Cola, its performance in the emerging markets left a lot to be desired. Net revenue was flat in Asia Pacific, fell 4% in Eurasia and Africa, and declined 8% in Latin America.

Smooth sailing for PepsiCo
As an indication of its outperformance, PepsiCo increased its full-year forecast after reporting second-quarter earnings. The company expects earnings-per-share growth to be 1 percentage point ahead of its prior forecast. Management now anticipates generating 8% EPS growth this year.

Both PepsiCo and Coca-Cola are similar on the surface. They sell many of the same products, and their stocks both hold similar valuations and pay similar dividend yields. But underneath the surface, it appears that Coca-Cola is struggling with stagnating case volumes, which PepsiCo is navigating much better thanks to its food business.

Plus, even when it comes to beverages, PepsiCo is executing better than Coca-Cola in the all-important emerging markets. Growth in sparkling beverages has flatlined in the United States, but underdeveloped nations still represent a great opportunity that Coca-Cola missed out on last quarter.

These are the reasons that two seemingly identical companies can react so differently after earnings.