The restaurant industry is an intensely competitive arena.

More than half of all restaurants close within their first three years. Relatively few thrive over the long term. And only a tiny fraction of those success stories become publicly traded chains capable of rewarding investors year after year.

The following two companies stand among this elite group -- and their stocks are particularly compelling buys today.

A miniature gold bull on top of a keyboard button labeled buy

Image source: Getty Images.

The titan

With more than 38,000 restaurants in over 100 countries, McDonald's (MCD -0.38%) has a massive global footprint. Its primarily franchise-based model is highly profitable, generating operating margins of more than 40% and net margins of nearly 30%. McDonald's also produces bountiful free cash flow, to the tune of $4.2 billion in 2018. The restaurant giant passes much of this cash on to shareholders via stock buybacks and a steadily rising dividend.

McDonald's strong cash generation also allows it to invest in innovative new technologies. It acquired decision-logic technology specialist Dynamic Yield for a reported $300 million in March. The chain will use Dynamic Yield's personalization technology to customize its drive-thru displays based on factors such as time of day and weather, as well as customers' selections. It also acquired Apprente, a leader in voice-based technology, in September. McDonald's says Apprente's tech will allow it to automate order-taking at its drive-thrus, making service faster and more accurate. 

These tech initiatives are improving the efficiency of McDonald's operations, and sales are rising too. Global comparable sales rose 6.5% in the second quarter, despite challenging industrywide traffic trends in the U.S. Profits could grow at an even faster rate in the coming years, particularly if McDonald's tech investments help it keep a lid on labor costs. That, in turn, should allow the fast-food champ to reward its investors with a growing dividend stream and continued share-price appreciation.

The recovery story

The turnaround at Chipotle Mexican Grill (CMG 1.39%) has been impressive. Under CEO Brian Niccol, who was the CEO of Taco Bell before he joined Chipotle in March 2018, the fast-casual burrito chain has largely recovered from the damage to its image caused by a string of food-borne illness outbreaks. Those incidents led significant numbers of its previously loyal customers to shun it, and by February 2018, just before Niccol's arrival, had driven its share price down to about a third of its 2015 high. In recent months, though, Chipotle stock has been setting new all-time highs, and is up 90% so far this year -- with multiple signs that suggest more gains  lie ahead.

Several initiatives are contributing to the company's rebound. Chipotle's app, which allows users to place their orders from their phones and bypass the main lines when picking them up, has been well-received by new and longtime customers alike.  It also facilitates Chipotle's loyalty rewards program, which is helping to boost repeat purchases, as are its deal with third-party delivery service DoorDash, and its new drive-thru lanes

Thanks in part to these growth drivers, Chipotle's digital sales surged 99% year over year to $262 million during the second quarter. Digital orders now account for more than 18% of the restaurant chain's total sales -- a figure that's likely to rise steadily as more people become accustomed to ordering via its app. With its digital ecosystem fueling growth, investors can expect Chipotle stock to continue to hit new all-time highs in the coming years.