If you delight in coffee and other beverages, then you're undoubtedly familiar with Starbucks (SBUX -0.66%) and Keurig Dr Pepper (KDP 0.07%). But enjoying them is one thing -- investing in them is another.

Understanding a company is a key first step. As legendary fund manager Peter Lynch noted, "invest in what you know" is an important component in the stock investing process. This common-sense advice is worth listening to, given his tremendous investing track record when he ran the Fidelity Magellan Fund from 1977 to 1990.

But there's more work to do before deciding which is the better company in which to place your hard-earned money. It's time now to drink in the details to make that determination.

A woman looking out a window while sipping coffee.

Image source: Getty Images.

1. Starbucks

Starbucks is best known for serving coffee, but it also sells other beverages such as tea. Combined, these drinks account for three-quarters of its revenue. Customers can also purchase certain food items.

The pandemic hurt Starbucks' fiscal 2020 results, which ended on Sept. 27, to the tune of $5.1 billion versus management's expectations. This was due to various steps management took such as shutting locations and limiting capacity. Revenue was $23.5 billion, down by about 11%.

However, patrons started returning when governments relaxed restrictions. Same-store sales, which were down by 9% in the fourth quarter versus a 40% drop in the prior period, improved throughout the year.

This momentum continued in the first quarter, with comps faltering by 5%. Management remains upbeat about the future, with its guidance calling for an 18% to 23% comps increase for the year. It's looking for strong results in its two largest markets, with U.S. comps rising by 17% to 22% and China's increasing by 27% to 32%.

These two areas represent more than 60% of its nearly 33,000 restaurants. China remains a growth area with more than half of the company's planned net openings of 1,100 this year coming from that country. While COVID-19 affected its Chinese locations initially, the region has recovered nicely, and first-quarter comps rose by 5%.

In a sign of confidence about Starbucks' future prospects, the board of directors raised November's quarterly dividend by 10% to $0.45, and the yield is currently 1.7%. The company has increased payments since initiating a dividend in 2010.

2. Keurig Dr Pepper

Keurig Dr Pepper sells beverages like soda, water, juice, and hot beverages -- e.g., coffee and tea "K-Cups" -- under brands like Dr Pepper, Canada Dry, Snapple, and Green Mountain. There's also its Keurig single-serve brewing machine, which has the highest market share in North America.

The company sells K-Cup pods under its owns brands like Green Mountain, but also makes it for others such as Starbucks, Dunkin' Donuts, and Restaurant Brands International's Tim Hortons under manufacturing and licensing deals. In fact, it produces 75% of the single-serve K-Cups sold in the U.S. Selling to individuals and businesses has helped Keurig Dr Pepper since companies closed offices and more people worked from home.

Packaged beverages, its largest revenue source, continued to gain market share, an impressive feat in a competitive marketplace where it faces the likes of Coca-Cola and PepsiCo. Keurig Dr Pepper's third-quarter adjusted revenue rose by 5.8%.

While Keurig Dr Pepper pays a dividend, you shouldn't count on the board of directors increasing the payout. It's remained at $0.15 a quarter since 2018, and the yield is currently 1.9%.

The better buy

While Keurig Dr Pepper's single-brew coffee systems help it stand out, a good chunk of its business -- soda and other drinks -- is facing considerable competition from well-heeled companies. Starbucks, on the other hand, has differentiated itself with various brews and built a loyal following. It still has strong growth prospects, particularly internationally. The kicker is the reliably higher dividend payments.

With these attributes, I give Starbucks the edge.