In 1897, Jerome Monroe Smucker started selling apple butter out of an Ohio cider mill with a horse and wagon. This was the start of the J.M. Smucker (SJM -1.37%) company. And from these humble beginnings, it would move on to the products that made it famous: fruit jellies.

In the 1940s, Smucker further branched out into ice cream toppings, such as chocolate and butterscotch sundae syrups. And in 1982, the company added to its ice cream lineup by acquiring the Magic Shell brand.

Indeed, Smucker is much more than a jelly company. Today, the company has grown into a consumer-foods powerhouse. In its fiscal 2023 (which ended in April), it had $1.6 billion in revenue from consumer foods, which includes jellies, Jif peanut butter, Uncrustables frozen sandwiches, and more.

I doubt Mr. Smucker envisioned a $1.6 billion business as he moseyed down Ohio roads in his horse-drawn wagon. It's an impressive feat, to be sure. J.M. Smucker has even grown large enough to be a constituent of the S&P 500 -- an elite group of 500 of the largest U.S. companies.

All of this said, Smucker never stopped diversifying its business. And today, there are two entirely separate product categories that are bigger than its consumer-foods business, accounting for a whopping 71% of its overall profits. This is surprising for most investors but crucial to understanding the business.

Smucker's surprising diversification

Today, Smucker makes more money from pet food and coffee than it does from consumer foods. In its fiscal 2023, the company generated almost 36% of its net sales from pet foods and another 32% of net sales from coffee.

Turning to the bottom line, pet foods and coffee have been quite profitable for Smucker. In its fiscal 2023, almost 29% of its profit came from pet foods and almost 43% of its profit came from coffee. That works out to 71% of Smucker's profits coming from products outside of its consumer-foods segment.

When it comes to pet foods, many people would likely recognize its popular brands such as Milk-Bone and Meow Mix. When it comes to coffee -- its most profitable segment -- Smucker owns such well-known brands as Folgers and Café Bustelo. The company also licenses the Dunkin coffee brand to sell coffee products, boosting revenue and profits even more.

What does this mean for investors?

Smucker is a far more diversified company than what many people believe. And it's not constrained by its current portfolio of products. Management frequently parts with products that it no longer believes in and acquires brands that it believes can boost margins.

For example, in 2023 Smucker sold well-known brands of pet food such as 9Lives and Kibbles 'n Bits to Post Holdings. In 2020, the company sold Crisco to B&G Foods. And in November, it acquired Hostess Brands for $5.6 billion -- a company that produced well-known brands such as Twinkies.

Smucker frequently changes its portfolio of products to both grow revenue and maintain profit margins. As the chart shows, the company has managed some modest revenue growth over the years. And its operating margin is impressive at about 16%. In other words, investors can expect modest growth but healthy profits.

SJM Operating Margin (TTM) Chart

SJM Operating Margin (TTM) data by YCharts

Since growth is modest, capital allocation (how a company spends money) is an important factor to consider when researching J.M. Smucker stock. In recent years, management has almost perfectly balanced spending in four categories: capital expenditures (investments in the business), paying down debt, repurchasing shares, and paying a dividend.

All of these things could be good news for Smucker's shareholders. When done well, capital expenditures can modernize manufacturing and reduce costs. Repurchasing shares increases the value of remaining shares. And the company's dividend is attractive, with a current yield of 3.3%. It's also increased its dividend for 22 consecutive years, and this streak should continue.

Repaying debt is also a good thing for Smucker going forward. The company's debt increased substantially to acquire Hostess.

SJM Total Long Term Debt (Quarterly) Chart

SJM Total Long Term Debt (Quarterly) data by YCharts

If Smucker were only a jelly and ice-cream topping company, I'm not sure if it would make a good investment. But looking at its diversity, profitability, and capital-allocation strategy, I believe J.M. Smucker stock is very likely to generate positive returns over the next five years.

Smucker's growth is modest, so its returns might not be market-beating. But for investors looking for a stock with a high probability of making money, J.M. Smucker is a solid candidate.