What happened

McCormick (MKC -1.52%) shareholders trounced the market in April, with the stock rising 1% compared to a 9% dive in the S&P 500, according to data provided by S&P Global Market Intelligence.

The uptick added to a wider outperformance for the spices and flavorings giant, whose shares are up about 1% so far in 2022 compared to the market's 14% slump. It was driven by McCormick's solid operating results, plus a flight toward stable, dividend-paying stocks.

A person cooking at home.

Image source: Getty Images.

So what

McCormick announced just before the start of April that its positive sales trends are holding up well even compared to booming results in the 2021 fiscal year. Revenue rose 4% in the first quarter of 2022, on top of a 20% spike a year earlier.

That success reflected the company's popular portfolio of spices, flavorings, and sauces. It also suggests demand is holding up for home cooking products even as consumers return to restaurants following the pandemic lull.

And, because it was partly driven by rising prices, the sales boost implied McCormick's business is inflation-proof to some extent. The company seems to have the power to minimize the price hikes it needs to pass along to consumers while maintaining rising sales volumes.

The stock also benefited from a tilt in Wall Street demand away from more speculative areas of the market like tech stocks and e-commerce specialists. A rotation out of many of these investments toward stable dividend payers tends to lift companies like McCormick. The packaged food specialist has thrived through many recessions and inflationary periods in the past, after all. It has raised its dividend in each of the last 36 years, making it a sturdy Dividend Aristocrat.

Now what

McCormick faces some real challenges ahead, including further price increases set to hit many of its products in 2022. These hikes are always a risk as they could drive more demand toward cheaper brands. And McCormick's profitability could take a hit if consumers begin to move away from high-margin products like its hot sauces and condiments.

Yet McCormick's leading position in a growing niche within the consumer staples industry makes it a good option for investors seeking to minimize volatility and maximize dividend income.

Those factors made the stock an attractive buy before the latest market downturn created a bigger premium for steady, profitable businesses. They create an even more compelling case for the stock today.