Chipotle Mexican Grill (CMG -1.34%) just put to rest any concerns that food and labor inflation were hurting its performance.

In an environment where Walmart just said consumers are cutting back on discretionary spending, the restaurant chain delivered double-digit comparable sales growth, up 10.1% from the quarter a year ago in its second-quarter earnings report released after hours Tuesday. Since 2019, comparable sales are up a whopping 30%. The stock soared 13% Wednesday morning as investors cheered the news.   

With concerns about the pandemic fading, consumers flocked back to dine-in experiences as in-restaurant sales jumped 35.9%, but the digital channel still represented 39% of revenue. Chipotle is executing its digital strategy perfectly as the online channel, which includes delivery and its drive-thru concept Chipotlanes, is complementing in-store sales, rather than cannibalizing them. Digital sales provided a needed relief valve during the peak of the pandemic. 

If inflation did have an impact on the company's performance, it was more likely to show up on the bottom line than the top, but Chipotle's profit numbers were just as impressive. Operating margin improved from 13% to 15.3%, and restaurant-level operating margin rose from 24.5% to 25.2%. Adjusted earnings per share jumped 25% to $9.30, ahead of estimates at $9.04. 

While management did acknowledge some impact from cost inflation, including in avocados, packaging, dairy, beef, and chicken, it clearly wasn't enough to put a meaningful dent in the company's growth. The company is planning to raise prices in August. 

The simple secret to its success

CEO Brian Niccol has gotten a lot of credit for turning the company around following the E. coli scandal. With some clever marketing and public relations, Niccol has helped earn back trust from customers following the company's serious food safety issues and oversaw aggressive investment in the digital channel. He's also grown Chipotle's loyalty program, ramped up usage for Chipotle's app, formed delivery partnerships with third-party providers like DoorDash, and expanded Chipotlanes, which allow customers to pick up online orders without leaving their car. The success of the digital channel has allowed Chipotle to take advantage of second "make lines" in restaurants, or stations where they prepare orders, which increase profitability, allowing the company to boost capacity without opening a new restaurant.

Above all, though, the secret to its success is simple: The company has a good product. The popularity of its food, combined with a business model, means Chipotle has one of the highest average unit volumes in the fast food industry, clocking in at $2.66 million excluding delivery fees. Its customer loyalty has also given it pricing power, allowing it to pass along prices as needed to absorb higher costs.

Is Chipotle stock a buy?

Chipotle stock has been expensive for almost all of its history as a publicly traded company, but after the second-quarter earnings report, which includes a record for earnings per share, the stock is looking reasonably priced. Currently, Chipotle trades at a price-to-earnings ratio based on 2023 estimates of 36 and those estimates are likely to go up after the Q2 report.

The burrito chain currently operates 3,000 restaurants and sees room in the market for 7,000 in North America over the long term, growing its restaurant base by 8% to 10% annually. That estimate could move higher as the growth of the digital channel and Chipotlanes opens up more markets. As it grows and scales, profitability should continue to expand, and the company has demonstrated its resilience after navigating both the E. coli crisis and the pandemic.

While the stock may be more expensive than its restaurant peers, Chipotle has proven time and again that it's a superior business. It's worth paying up for.