Investors had good reasons to feel optimistic about McDonald's (MCD -0.12%) fiscal second-quarter earnings release. The fast-food titan was going up against an unusually weak year-ago period when widespread restaurant closures reduced sales and earnings.

McDonald's made up that lost ground -- and more -- in the three months that ended in late June, putting it in a stronger position now than it was back in 2019.

Let's take a closer look at the standout metrics from this week's quarterly report.

Four people eat inside a fast-food restaurant.

Image source: Getty Images.

Sales are setting records

Comparable-store sales rose 41% to mark a complete rebound from last year's 24% slump. The recovery was strong across the board, with comps growth landing at 26% in the U.S. market compared to a 9% decline last year. Developed international markets like France and the U.K. landed a 75% increase compared to a 41% drop. Developing markets including Brazil and China were up 32% versus last year's 24% decline.

Management broke down the growth over two years to give investors a clearer view of demand trends outside of pandemic-related swings. Sales were up 15% in the U.S. on that basis and rose 7% globally. "Our performance is a continued demonstration of the broad-based strength and resiliency of our business," CEO Chris Kempczinski said in a press release.

Making more cash

Executives said last quarter that McDonald's stores would become more profitable thanks to cost cuts, a slimmer menu, and a tilt toward online ordering and delivery. That prediction played out in a big way, with operating margin rising to 43% of sales over the last six months.

It helped that McDonald's could raise prices in the context of strong demand. More fast-food fans opted for premium meals and beverages, too.

The push toward digital ordering and delivery is having an even bigger impact. These sales tend to have much higher spending per order and are accounting for a greater portion of the chain's overall volume. "It's clear that our next chapter will be driven by our leadership in digital," Kempczinski explained.

Looking ahead

The big-picture trends show a business that's stronger today, both in sales growth and profitability, than it was just before the pandemic struck. But it's not yet clear whether McDonald's will take another step backwards due to continued COVID-19 uncertainty. New virus outbreaks are impacting a few markets already, and economic growth could stall in the core U.S. segment to reverse some of the recent consumer spending surge.

Yet McDonald's system handled the 2020 COVID-19 challenge about as well as shareholders could have hoped. Investors can now look forward to the chain using its drive-thru capabilities and delivery network to extend its dominant industry position.

Even if competitors had a small opportunity to knock the burger giant from that spot during the worst of the pandemic, that window is closing. McDonald's demonstrated again how adept it is at staying ahead of consumer demand shifts, even during wild changes in preferences like we've seen since early 2020.