Kroger (KR -0.14%) shareholders had high expectations heading into the supermarket giant's second-quarter report. Sales trends in early 2021 had been holding at a much higher rate than before the pandemic. And the company appeared on track to begin boosting its profitability higher toward peers like Target and Walmart (WMT -0.15%).

On Friday, Kroger delivered mostly good news along both of these lines even as CEO Rodney McMullen raised the chain's full-year outlook. Let's dive right in.

An employee stocking fresh produce.

Image source: Getty Images.

Kroger's sales are booming

Kroger revealed a second-straight quarter of declining revenue, with comparable-store sales falling 1%. But that decline was entirely due to soaring demand a year ago when pantry-stocking was near its peak during the early phases of the pandemic.

The better metric to follow in that environment is two-year sales, which are up 14% in Q2. That compares well to the 14.5% rate that Walmart, Kroger's main competitor, just posted. Investors had been worried that Walmart might be stealing more of Kroger's market share thanks to its stepped-up investments in the fresh produce aisle.

But the supermarket specialist held its own, in part thanks to improvements in its digital platform. "Our strategic focus on leading with fresh and accelerating with digital," McMullen said in a press release, "continues to build momentum across our business."

Kroger posted profit wins and losses

The profit picture was mixed, with margins dipping slightly thanks to rising costs in areas like wages and transportation. Kroger was also conservative with price increases during this inflationary period, which helped customer traffic at the expense of profitability.

KR Operating Margin (TTM) Chart

KR Operating Margin (TTM) data by YCharts

But the wider picture is bright, with operating profit rising at a 23% annual rate over the last two years. Kroger is emerging from the pandemic with stronger earnings power even if it is still catching up to its national retailing peers. "We continued to remove costs from the business," CFO Gary Millerchip explained.

Raising the outlook

Shareholders were treated to their second straight outlook boost in 2021. Kroger now sees sales rising by between 12.6% and 13.1% on a two-year basis, up significantly from the prior forecast ranging from 10.1% to 11.6%.

Earnings got a similar hike and are on track to land between $3.25 per share and $3.35 per share compared to the $2.95 per share and $3.10 per share target management issued back in June. Executives said they feel comfortable raising both of these targets due to sustained growth in the industry. "Customers are eating more food at home because it is more affordable, convenient, and healthier than other options," McMullen said.

That trend bodes well for most industry players to the extent that it persists beyond the pandemic. And Kroger could stand to benefit more than its rivals as it scales its multichannel selling platform up to their performance levels. Success at those levels might push its margins higher as it has for Target over the last two years or so, leading to potentially higher shareholder returns than Kroger's long-term goal of between 8% and 11% annual returns.