If you're hungry for a cheap stock to put in your portfolio, you're in luck. McDonald's (MCD 0.17%) shares have sat out of the market rally in the past year, barely rising since March 2023 compared to the 31% spike in the S&P 500. That performance is a bit surprising given that the fast-food titan was setting records around sales and earnings heading into early 2024.

There are some clouds on the horizon, to be sure. McDonald's noticed weaker spending and sluggish customer traffic in the core U.S. market over the last few weeks, and competition is heating up for those more cost-conscious shoppers. Rivals like Chipotle are targeting McDonald's industry lead in the drive-thru channel, and there are more pricing pressures now that inflation has slowed down.

Don't let these worries keep you away from the stock. McDonald's has all the ingredients necessary to generate solid returns from today's discounted share price. Let's look at some of the key reasons to love the stock right now.

1. Cash flow

If I had to pick a single metric to judge a stock against, then cash generation would rank near the top of the list. As the saying goes, "Cash flow is destiny." This metric is even more important for a dividend stock like McDonald's, because its payout is ultimately funded by cash production.

McDonald's -- and its dividend -- has a bright future ahead. The chain generates more cash than rivals thanks to assets like its huge global sales footprint and massive brand power. McDonald's produced $7 billion of free cash last year, up significantly from 2022 and translating into roughly 85% of earnings. The company's highly franchised selling model means it has a light annual spending commitment as compared to a business like Chipotle, which owns most of its stores outright.

It's no surprise, then, that McDonald's can pay (and steadily increase) a quarterly dividend. The last raise was 10%, and its cash flow trends imply further big hikes ahead.

2. Profit margin

McDonald's makes a lot of money by selling affordable fast food. In fact, its profit margin is approaching a record 50% of sales right now, far above Chipotle and other peers. A lot of that gap can be explained by its franchise-selling setup. McDonald's generates much of its earnings through high-margin royalty, real estate, and rental fees, and these revenue streams are much more profitable than traditional markups on food sales.

MCD Operating Margin (TTM) Chart

MCD Operating Margin (TTM) data by YCharts

The two main ingredients to awesome long-term returns are a high profit margin plus ample opportunities to generate good returns on those earnings. McDonald's has no shortage of growth initiatives, which lately have included a push to boost customer satisfaction by reducing wait times and improving product quality. There's also a big opportunity around online ordering and delivery.

3. The price is right

The best news is that investors have a chance to supersize their investments in McDonald's right now thanks to the pessimism surrounding the fast-food giant's shares. The company said customer traffic dipped into negative territory at the start of 2024, raising fears that comparable-store sales gains will slow to a crawl this year. That spooked Wall Street, and now the stock is valued at 8 times sales, down from over 9 times sales at a few points in 2023.

Traffic is the metric to watch, then, as the most impactful factor influencing the shares in the short term. But patient investors can look past that noise and focus on McDonald's excellent prospects for earnings growth over the next decade or more.