When investors look for stocks that outperform, they'll often compare investments to the S&P 500 index. That broad market barometer is a fine yardstick, but just outpacing the market may not be enough information to see what's really going on.

One example is Costco Wholesale (COST 1.01%) which is beating the S&P 500 year to date in 2023 as it continues to execute well on a differentiated and long-successful business model. B&G Foods (BGS 1.19%) is also beating the S&P 500 at the moment, but it is rebounding from a deep decline that was precipitated by some troubling developments. Those developments are still impacting the company's business.

What went wrong for B&G Foods?

B&G Foods is a food maker with a stable of well-known brands, including Cream of Wheat, Crisco, Green Giant, Durkee, and several others. From a brand perspective, it manages itself fairly well. It usually buys brands that are smaller and growing or ones that are large but have been neglected. It tends to buy them from a dominant food maker that has lots of successful brands. In both cases, B&G lavishes some love on the new brands (increasing advertising, distribution, and product development) to boost growth.

The problem is that buying food brands is costly and B&G has long made aggressive use of its balance sheet. When interest rates started to rise in 2022 the company's outsized leverage became a real drag on the business and it had to cut its dividend to manage the situation. Despite beating the S&P so far in 2023 (up 26% versus 16% for the S&P 500), the B&G Foods stock is still down over 42% over the past three years. The company's biggest problem right now is probably dealing with its exploding interest costs, which rose nearly 50% year over year in the first quarter. Of course, while it is dealing with this outsized company-specific issue it also has to absorb rising ingredient and salary expenses that are hampering its peers, as well.

B&G Foods' dividend yield is attractive at 5.4%, but right now it is dealing with a business turnaround that still hasn't fully played out. The risks probably outweigh the rewards, noting that earnings plunged from $0.34 per share in the first quarter of 2022 to just $0.05 per share in 2023 while the company's dividend in the quarter was $0.19 per share (down from $0.45 a year ago).

SPY Chart

SPY data by YCharts

Costco has a solid core

Costco, on the other hand, continues to operate from a position of strength and is edging the S&P 500 so far this year. Although the company is a retailer, the real heart of its business is the members that pay an annual fee for the privilege of shopping at its stores. Some numbers will help. In the fiscal third quarter of 2023, the company's top line totaled $53.6 billion. Of that $52.6 billion was from product sales. The cost of selling those products totaled about $52 billion, meaning that product sales contributed around $600 million in gross profit. Membership fees totaled just over $1 billion. With few associated costs, membership fees flow right down to the company's gross margin. Gross margin in the quarter was basically $1.6 billion, with membership fees contributing roughly 60% of the total.

Everything the company does is in service to its customers, most notably keeping costs so low that people continue to renew their memberships. In the first quarter, the renewal rate was a robust 90% or so. So membership fees are pretty annuity-like. With plans to get new store openings to a rate of 25 or more a year, each new club member added at a new location pushes the hugely important membership fee line up even more. 

This is what backs the company's roughly two decades of annual dividend growth, with an annualized dividend growth rate of 12% over the past decade. Investors are well aware of the company's success, and the yield is a bit miserly at 0.8% or so. However, for dividend growth investors the model here is highly attractive and it continues to work very well.

Know what you own

While it would be hard to suggest that Costco is a screaming buy even as it beats the S&P 500 this year. It is almost always an expensive stock because of its long history of success and strong business model. But long-term investors, particularly those with a dividend growth focus, should at the very least keep it on their wish list.

B&G Foods, meanwhile, is operating from a position of weakness. While turnaround investors might find that appealing, there are material risks today that suggest its current outperformance relative to the market is being driven by swings in investor sentiment and not fundamental business strength. If you had to pick between these two stocks, Costco would probably be the winner for most investors.