It's inevitable that every company will at some point face a crossroads. Part of successful investing involves knowing which companies can navigate those crossroads and keep growing. This requires understanding a company's competitive advantage. Some companies have enduring traits like a powerful consumer brand that allows it to adapt much more easily than others to changing business conditions. 

IBM (NYSE:IBM) and McDonald's (NYSE:MCD) are two companies that have faced significant obstacles in recent years. IBM has found itself loaded down with old business lines that are not adept for the new age of cloud computing and mobile technologies. On the flip side, we have the Golden Arches, which has had to transform its brand image to win over a new generation of customers.

A woman looks at two roads forking in different directions in a mountainous countryside.

IMAGE SOURCE: GETTY IMAGES.

It hasn't been easy for either company. IBM shares have trailed the broader market, up only 48% over the last 10 years. However, McDonald's iconic brand has served it well. Shares of the classic restaurant chain have managed to keep pace with the broader market, up 222% over the last 10 years, which is in line with the S&P 500's return of 217%. 

It might already be clear which is the best bet going forward, but before we jump to conclusions, let's take a deeper look at each company to see which is the better buy for investors today.

Financial fortitude

Financial fortitude doesn't mean much when times are good. It's when the economy goes through those inevitable downturns that things like high debt and interest expense can put extra stress on a company. Here's a look at the current financial position of IBM and McDonald's:

Metric IBM McDonald's
Cash $12.00 billion $2.575 billion
Debt $45.81 billion $31.9 billion
Revenue (TTM) $79.59 billion $21.2 billion
Free cash flow (TTM) $11.53 billion $4.056 billion
Times interest earned 22.59 9.31

Data source: YCharts. TTM = Trailing 12 month.  

Both companies like to carry a lot of debt, which is fine because IBM and McDonald's generate a high volume of sales every year, and both earn recurring business from repeat customers. IBM generates more free cash flow, but that's a result of its higher revenue.

The key differentiator here is the metric called times interest earned. This is an important measure of financial health that tells us how many times a company can pay the interest expense on its debt out of operating income (earnings before interest and taxes).

IBM can cover its interest expense 22.6 times out of its annual operating income, whereas McDonald's can only cover its interest about nine times over. The higher that number, the better, so the edge here goes to Big Blue.

Winner: IBM

Valuation and dividends

A comparison between two stocks is never complete without checking each stock's valuation. Here's how shares of both IBM and McDonald's stack up on a range of popular valuation metrics, including their current dividend yields:

Metric IBM McDonald's
Trailing P/E (price-to-earnings) ratio 21.36 28.47
Forward P/E ratio 9.38 22.77
PEG ratio 9.25 2.56
Price-to-free cash flow ratio 10.53 36.60
Dividend yield 4.69% 2.24%
Dividend payout as a percentage of free cash flow 49.14% 78.04%

Data source: Y-Charts and Yahoo! Finance.  

At first glance, you might think IBM is the winner here, but overall, I would call this a tie. Big Blue sports a lower P/E ratio on both a trailing and forward-looking basis. IBM also has a higher dividend yield while paying out a lower percentage of its free cash flow as dividends.

However, McDonald's has a much lower PEG (price-to-earnings-growth) ratio. This is because analysts only expect IBM to grow earnings 0.96% annually over the next five years, while McDonald's is expected to increase profits by 9.3% annually. We'll get into the reasons why in the next section, but McDonald's lower PEG ratio compared to IBM's higher dividend yield creates a draw, here.

Winner: Tie.

Competitive moat

For years, IBM has been struggling to find growth while its legacy hardware and services become increasingly obsolete due to the growth in the cloud market. The company has sold off many businesses and acquired newer ones along the way. As a result, IBM currently produces about 21% less revenue and free cash flow than it did a decade ago.

The future of computing is quickly shifting to the cloud market, where IBM badly trails competitors, with only 2% market share. Corporations are moving their entire data systems over to the cloud, which means IBM needs to gain share and win over some of these customers or risk becoming irrelevant.

IBM helped itself by going out and buying cloud service provider Red Hat for $34 billion toward the end of 2018, but some analysts remain uncertain about the company's prospects in the fast-growing cloud market. IBM's cloud business grew 12% in 2018 and 21% (adjusted for currency changes) in the fourth quarter. At first glance, that performance looks solid until you realize that Microsoft's Azure cloud business grew revenue 76% year over year in the third quarter. 

IBM Chart

IBM data by YCharts.

On the other side, the iconic fast-food chain has been reporting solid operating results. Margins have expanded, and comparable-store sales have been growing. Management is currently in the middle of spending $6 billion through 2020 to modernize most restaurants with new interiors and exteriors, simplified ordering, and upgraded parking lots to accommodate customers who use the new curbside pickup service.

Mickey D's is on the offensive by aggressively investing in digital ordering and delivery capabilities, an area where the company may have a significant competitive advantage given its enormous footprint of 37,557 restaurants open around the world. The company claims most of the population in its five largest markets live within three miles of a McDonald's. That is an advantage management will surely try to capitalize on as the restaurant industry works to follow the lead of innovators like Panera Bread and others that have successfully integrated mobile apps in the customer ordering experience. 

Big Blue is looking big and blue, while the Golden Arches are standing tall.

Winner: McDonald's.

Take the Big Mac

We have IBM winning on financial fortitude and a tie between the two companies on valuation and dividends. I believe it's best to give the tie-breaker to the company with the wider competitive moat. Therefore, McDonald's is the better buy.

It can be very tempting to buy shares of a recognizable name like IBM when it sports an ultra-low valuation and high dividend yield. However, if you're looking to put your hard-earned money into a stock that you can be confident will climb in value over decades, I believe the best option is to pay up for a company like McDonald's that has a long record of growth and a wider competitive moat.

Teresa Kersten, an employee of LinkedIn, a Microsoft subsidiary, is a member of The Motley Fool's board of directors. John Ballard has no position in any of the stocks mentioned. The Motley Fool owns shares of Microsoft. The Motley Fool has a disclosure policy.