Apple (AAPL 0.64%) and International Business Machines (IBM 0.16%) are two of the world's most iconic technology companies. Yet their fortunes have diverged in recent years. Apple's earnings have soared, while IBM has struggled to adapt to changing times.

But which of these tech giants is the best buy from this point forward? Let's find out.

Two chess piece kings on opposite ends of a scale

Image source: Getty Images.

Competitive strategy and growth prospects

For decades, IBM's hardware dominated the tech landscape. Yet as the world becomes more mobile and cloud-based every day, demand for IBM's enterprise hardware and IT services has weakened. In response, the company has shifted its investments toward higher-growth "strategic imperatives," which include its cloud, mobile, analytics, and cybersecurity operations. This has helped to mitigate the decline in its legacy businesses but has so far failed to drive gains in overall revenue growth.

Conversely, Apple has continued to enjoy extensive gains in revenue and earnings. Apple's strong brand and customer loyalty give it the ability to command higher prices for its products -- and correspondingly higher profit margins. In turn, Apple captures more than 70% of the smartphone industry's profits annual profits, even as its phones account for less than 20% of units sold. Moreover, rising average selling prices helped Apple's iPhone revenue surge 29%, to more than $37 billion, in the fiscal fourth quarter of 2018. 

To further monetize its massive installed base of iPhones, iMacs, and iPads, Apple has focused on expanding its fast-growing services business. Its Q4 services revenue -- which includes Apple Music, the App Store, and Apple Pay -- jumped 17% year over year, to $10 billion. 

IBM, meanwhile, has turned to expensive acquisitions to boost growth. In October, it announced a deal to acquire Red Hat (RHT) for $34 billion. That's a hefty price for a business that generated only $3.2 billion in revenue over the past year. 

All told, Apple's revenue, operating profits, and operating cash flow have all grown by more than 40% over the past five years, while IBM has seen these metrics decline.

AAPL Revenue (TTM) Chart

Data by YCharts.

Over the next five years, Wall Street expects Apple to increase its earnings per share by 13% annually, fueled by the growth of its booming services business and massive share buybacks. Meanwhile, IBM's profits are projected to rise by less than 1% annually, as revenue growth is likely to remain a challenge. So here, too, Apple outshines IBM.

Advantage: Apple

Financial strength

Let's now take a look at some key financial metrics to see how Apple and IBM compare.

Metric

Apple

IBM

Revenue

$265.60 billion 

$80.37 billion 

Operating income

$70.90 billion

$12.07 billion

Operating cash flow

$77.43 billion

$16.86 billion

Free cash flow

$64.12 billion

$12.74 billion

Cash and investments

$237.10 billion 

$14.7 billion 

Debt

$114.48 billion 

$46.9 billion

Data sources: Morningstar, company financial filings. 

IBM does an admirable job of converting more than 15% of its revenue into free cash flow. It also has nearly $15 billion in cash reserves. Together, these factors place the tech giant on solid financial footing.

Apple, however, is in a league of its own. With $70 billion in operating profits, nearly $65 billion in free cash flow, and more than $237 billion in cash and investments, Apple's financial strength is simply unmatched.

Advantage: Apple

Valuation

Finally, let's take a look at some value metrics, including price-to-free cash flow (P/FCF), enterprise value-to-EBITDA (EV/EBITDA), and price-to-earnings (P/E) ratios.

Metric

Apple

IBM

P/FCF

11.91 

8.21 

EV/EBITDA

10.19

8.36

Forward P/E

10.98

8.28

Data sources: Yahoo! Finance, Morningstar.

Across all three metrics, IBM's stock is significantly less expensive than Apple's. This is to be somewhat expected, considering Apple's higher expected earnings growth.

Still, IBM's shares are currently 30% and 25% cheaper per dollar of free cash flow and expected earnings, respectively. Even if we account for Apple's and IBM's different capital structures (remember, Apple has $122 billion in net cash while IBM has $32 billion in net debt) -- as we do with the enterprise value-to-EBITDA ratio -- IBM's stock is still more attractively priced.

Advantage: IBM 

The better buy is...

IBM's stock may be cheaper. But it's no surprise that Apple's stronger competitive position, greater growth prospects, and superior financial strength make it the better buy today.