Conventional thinking says that fortunes are made in bull markets and lost in bear markets. But that's not always the case.

Some businesses excel during difficult economic periods, and their stocks rise as others fall. McDonald's (MCD 0.37%) is one such company. Here are three reasons why.

1. McDonald's is recession-resistant

The restaurant titan tends to see its sales strengthen during challenging economic periods as people trade down to less expensive meals. We're seeing this play out right now. McDonald's comparable sales surged nearly 13% in the first quarter. Its adjusted earnings per share, in turn, jumped 15% to $2.63.

With inflation driving many people to reduce expenses, McDonald's valued-priced menu is proving popular. This remained true even as the fast-food chain raised prices to offset its own food and labor cost pressures. McDonald's guest counts still rose across all its market segments. 

Chief Financial Officer Ian Borden said during the company's first-quarter earnings call that despite the price hikes, McDonald's relative affordability is resonating with consumers -- and helping it outperform its rivals. 

2. McDonald's is adapting with the times

The hamburger hulk's focus on value, convenience, and speed of service is a time-tested strategy. But this isn't your grandpa's McDonald's.

Technology investments are reshaping McDonald's operations and driving growth. Across its top six markets, digital sales grew by 30% year over year in the first quarter and now account for nearly 40% of the chain's systemwide sales. 

Moreover, digital apps are helping McDonald's strengthen its bond with its customers. The MyMcDonald's rewards program, and the transaction data collection it facilitates, allow for a more personalized consumer experience. Better still, the loyalty program's roughly 50 million active members tend to visit McDonald's restaurants more often. 

Automation is another area of intense focus. McDonald's is testing a smaller store format with mechanized drive-through lanes and quick-pickup stations catered toward delivery drivers and customers on the go. The fast-food giant is constantly on the hunt for ways to increase the speed and accuracy of its operations.

"We've been setting the standard for Drive Thrus for more than 45 years," McDonald's executive Max Carmona said in a press release announcing the test in December. "As our customers' needs continue to change, we are committed to finding new ways to serve them faster and easier than ever before."

3. Investors have larger dividends headed their way

With over 40,000 locations worldwide, McDonald's stores are indeed ubiquitous. But don't let that fool you into thinking growth will be hard to come by. Management plans to open 1,500 net new stores in 2023 alone. 

Additionally, McDonald's is restructuring its business to slash costs and boost efficiency. These efforts should drive its already stellar profit margin even higher. The company's primarily franchise-based model enabled it to convert a whopping 43% of its revenue into operating income in the first quarter. 

McDonald's pays out approximately 60% of its earnings as dividends. So as its profits grow, its cash payout to its shareowners should, too. Most recently, the company boosted its quarterly payment by 10% to $1.52 in October. The move lengthened an impressive 46-year streak of annual dividend increases. 

McDonald's shares now yield a solid 2% annually. Combined with its projected annualized earnings growth of more than 8% over the next five years, these cash returns should allow the restaurant juggernaut to deliver wealth-building gains on the order of 10% annually to investors who buy its stock today.