Human beings have to eat, which is why food makers are often looked to as reliable businesses. This segment of the consumer staples space is filled with options, but Hormel Foods (HRL 0.14%) and Hershey (HSY -0.53%) are two of the most interesting today because of the challenges they are facing.

The big story, and why you might want to double up on these dividend stocks, is that the problems that have Wall Street so worried are likely to be temporary. Here's what you need to know.

Hormel is getting hit on all sides

Hormel's dividend yield is 3.6%, which happens to be near the highest levels in the company's history. That suggests the stock has been placed in the bargain bin. The problem for investors is that Hormel's troubles have been going on for a number of years at this point. And yet, none of these problems seems likely to be permanent.

HRL Chart

HRL data by YCharts

For example, the company hasn't been as successful in passing inflation-driven price increases on to consumers. That's not good, but historical trends in the consumer staples industry suggest that, in time, consumers will grow more accustomed to higher prices and return to normal buying patterns. Hormel's turkey business has been grappling with supply issues because of avian flu. This isn't company-specific and will likely improve at some point, as has happened before. Hormel's foreign operations are heavily reliant on China, which hasn't recovered as quickly as expected after COVID-19 lockdowns ended. That, too, should improve in time, if the progress of the rest of the world is any indication. And finally, the company's recently acquired Planters brand is facing a difficult nut market. But Planters has been outperforming the nut business, which suggests Hormel is doing a good job even in the face of tough times.

The length of that list of woes seems daunting, which is probably why investors are so downbeat on Hormel. But Hormel simply needs time to work through each one. If you can stomach a little uncertainty, this Dividend King could be a great addition to your portfolio.

At Hershey's, chocolate is problem No. 1

Heshey's dividend yield is 2.4%. That's not quite as compelling as what's on offer from Hormel, but it is still near the higher side of Hershey's historical yield range. Often paying a fair price for a great company is a good plan if the business has solid growth prospects. And Hershey does, as it continues to expand into savory snacks, such as popcorn and pretzels, and looks to bring its iconic confection brands into more markets globally.

HSY Chart

HSY data by YCharts

The No. 1 problem for Hershey today is centered around inflation, but just for one item very specific to its business: cocoa. That's a basic ingredient in chocolate, which is the backbone of its confection operation. The problem is that cocoa prices are near all-time highs, leaving the company no choice but to keep raising prices. That's out of step with most other food makers, which are finally starting to see prices for important ingredients flatline or fall. But consumers like candy, so it seems likely that higher prices will eventually be accepted as the new normal.

There is one more notable headwind, but it is harder to quantify at this point. New weight loss drugs could dent the sales of Hershey's sugary snacks. While this is possible, exciting new drugs don't always turn out to be as impactful as hoped in the long run. While Hershey is a bit of a contrarian stance on these currently trendy drugs, human history suggests sweets will remain popular over the long haul. Buying Hershey while Wall Street is perhaps overexcited about a hot new product (weight loss drugs) could end up being a long-term win for dividend investors.

Every company has warts

There is no such thing as a perfect investment because they all come with trade-offs. The job of value investors is to figure out whether the good outweighs the bad enough to make a stock worth buying. Out-of-favor Hormel and Hershey both have attractive yields, strong businesses with great histories behind them, and problems that seem likely to be temporary in nature. Hold your nose and consider doubling down while other investors are fearful.