Investing in stocks has indefinite upside, a powerful concept for investors to keep in mind. Over the long haul, you can achieve incredible returns by simply striving to pick stocks to beat the market. And occasionally these stocks are absolute home runs. Some can even go up 10,000%, turning every $10,000 investment into $1 million (without even including dividends).

Stocks that rise in price this much are called 100-baggers. And McDonald's (MCD -0.11%) and Starbucks (SBUX 0.91%) are two restaurant stocks that have earned this title. If you bought McDonald's stock in 1982, you'd have a 100-bagger today -- likewise if you bought Starbucks stock in 1994.

Here's how these companies did it, and which stock can still beat the market going forward.

A group of women are served food at a restaurant.

Image source: Getty Images.

Achieving 100-bagger status

McDonald's has over 39,000 locations worldwide, while Starbucks has over 32,000. Their large size has helped place them among the top five largest restaurant stocks.

Before their respective 100-bagger journeys, each was a much smaller company. McDonald's ended 1982 with 7,259 locations; Starbucks ended 1994 with just 425. To expand as they have, the companies had to grow outside their U.S. home market.

For full-year 2019, just 37% of McDonald's total revenue was generated in the U.S. Starbucks generates less revenue internationally: 69% in the U.S. and Canada for fiscal 2019. But its international segment is still providing the bulk of its growth right now.

These 100-bagger restaurants achieved these returns with very different business structures. McDonald's is primarily franchised and generates a lot of revenue by being a landlord to its franchisees. By contrast, Starbucks' revenue is split pretty evenly between franchised and company-owned stores. So the business structure isn't the primary factor for these companies' success. Rather, new locations led to astronomical revenue growth.

But revenue growth isn't everything; being profitable also helps. A growing bottom line allowed the companies to not only reinvest in their businesses, but also reward shareholders through share repurchases and dividends. I think the following chart on McDonald's illustrates how these returns compound over time.

MCD Chart

MCD data by YCharts.

Revenue growth by domestic and international expansion, increased net profit margins, a reduced share count, and a growing dividend were all contributing factors in making McDonald's and Starbucks 100-bagger stocks. 

Why Starbucks has more upside right now

Admittedly, 100-bagger opportunities are very rare. Of the roughly 50 publicly traded restaurant stocks today, I wouldn't bet any of them could turn $10,000 into $1 million like McDonald's and Starbucks have done. But I believe several of them can beat the market average. And between these two 100-baggers, I'd wager Starbucks has what it takes to outperform for the next five to 10 years.

A Starbucks' barista hands a woman her drink at a Starbucks Pickup location.

A Starbucks Pickup location. Image source: Starbucks.

There are two big reasons I like Starbucks right now. First, it's still a growth company despite its massive operations. It has already returned to growth in China: For 2020, it plans to open 500 new locations in that country. And given China's population and the current store count there, Starbucks can open locations at this torrid pace for years.

Second, the COVID-19 pandemic has given Starbucks a renewed sense of urgency. Over the next 16 months or so, it will be executing a plan to close 400 U.S. locations with low sales volume. These will be replaced with a new takeout-only restaurant model called Starbucks Pickup. These two factors tell me it can still grow its top line with new locations and expand its profit margin with leaner operations. I believe that's a market-beating formula.

By contrast, McDonald's growth has hit a wall. In 2019, it generated $21 billion in revenue -- flat year over year. And that was before the pandemic. Revenue in the first half of 2020 is down 19% from the comparable period in 2019. I suspect business will bounce back as we move further past the coronavirus. But McDonald's is a low-growth, mature company in the best of times.

I don't mean to imply McDonald's is doomed. On the contrary, as a restaurant franchiser, it's among the very best in the business. By investing in menu innovation and technology, it consistently grows sales. In 2019, for example, systemwide sales were up 4% to $100 billion. But since it's mostly franchised, this increase in sales only translates to a negligible gain in corporate revenue.

Historically, McDonald's has rewarded shareholders through dividends and buybacks, which will continue. But with top-line growth challenged, it's limited in how much it can increase its shareholder-friendly moves. That's why Starbucks is a much safer growth investment: It can keep growing its business at a healthy clip from here.