Inflation has been terrible over the last year or so, making it more expensive to buy food. But the price you pay at the grocery store is really a function of the increased prices that food makers like Conagra (CAG 0.18%) have been paying for everything from ingredients to salaries to transportation.

However, Conagra hit a key goal in 2022, and that should help to set it up for a solid 2023 and beyond.

The rough numbers

Gross margin is basically the difference between a company's revenue and the cost of producing what it sells. This is a very important number for Conagra -- and, well, it was a rough figure to look at for a little while because the numbers were going in the wrong direction. The big problem was inflation, which was increasing the company's costs.

A person shopping in snack aisle of a grocery store.

Image source: Getty Images.

Inflation is a normal part of doing business, and food makers have a playbook: essentially, cut costs and raise prices. The problem is that there's a lag between when inflation hits and when the efforts to offset it actually start to benefit the company. So margins get squeezed for a bit, which often upsets investors who have a short-term mindset.

That said, Conagra ended 2022 on a strong note. It was the company's fiscal third quarter, but it represented the second consecutive quarter of gross margin improvement. To put a number on it, at 28.1%, Conagra's gross margin is essentially back to where it was in fiscal 2020, before the coronavirus pandemic upended the food industry. This is a massive achievement, given that gross margin plunged to 24.8% in fiscal 2022 when inflation was raging.

Chart showing Conagra's gross profit margin falling from mid-2021 to late 2022, then rising.

CAG Gross Profit Margin data by YCharts

A good year and more to come

With the strong gross margin improvement, the food maker has increased its fiscal 2023 adjusted earnings per share guidance from a range of $2.60-$2.70 to a range of $2.70-$2.75. So fiscal 2023, which only has one more quarter to go, is going to see an immediate benefit. But there's more to understand about this recovery.

When it comes to selling products in the consumer staples space, there are a couple of words that really draw customers into stores: "new" and "improved." Companies like Conagra are always investing money in their products so they can deliver innovative and novel things to retailers' shelves. It is one of the key ways that the larger companies in the industry curry favor with their direct customers (retailers) and with the end consumer. 

The problem is that a company will have a harder time spending money on research and development (R&D) if its gross margins are thin. So, Conagra's improving gross margins give it the wherewithal to put more money to work on the innovation front. In fact, innovation even helps to justify higher prices, since people are getting "more" for their money. Thus, investing in R&D is a winning move all around, with the spending coming out of the company's gross margin.

Being a good partner

Large food makers like Conagra offer retailers many things, including name brand products and strong distribution networks. But one of the most important is the ability to draw customers into stores. Yes, the name brands are a part of that, but perhaps even more important is the spending on innovation -- new and improved products that get customers excited about buying.

On that front, Conagra's gross margin returning to pre-inflation levels gives it the leeway to put more money to work on R&D. That's going to be a net benefit in fiscal 2023, as the company's raised guidance highlights, but will likely be even more important in fiscal 2024.