The past year has seen something of a reversal of fortunes for shares of Apple (AAPL -0.57%) and International Business Machines (IBM -0.89%). While Apple has outperformed IBM shares in recent years, the opposite has held true over the past 12 months.

AAPL Chart

AAPL data by YCharts.

So, is Apple stock or IBM stock the more attractive opportunity today? Let's examine each of these tech giants across three important investment and business criteria to determine which stock is the better buy.

Financial fortitude

Both companies are well-established and hugely profitable enterprises. However, there can be little doubt that Apple outshines IBM when it comes to the strength of its financial resources. Here's a quick overview of the two companies' most pertinent balance sheet and leverage ratios.

Company Name

Cash & Investments

Debt

Cash From Operations (TTM)

Current Ratio

Apple

$237.4 billion

$87.0 billion

$65.8 billion

1.35x

IBM

$14.9 billion

$42.4 billion

$18.5 billion

1.20x

Data source: Apple & IBM investor relations. TTM = trailing 12 months.

Importantly, as of its most recent quarter, $216 billion of Apple's cash and investments are held overseas to avoid paying repatriation taxes that could eat billions from the company's gross cash balance. As such, the number in the chart above overstates Apple's actual day-to-day liquidity, though Apple is confident its liquidity remains sufficient to fund its continued business needs.

IT giant IBM also adeptly manages its balance sheet. The company leverages its investment-grade credit rating as a source of cheap financing, and its strong cash generation allows it to do so without placing its liquidity in jeopardy. As perhaps the bluest of the blue chips, IBM's century-plus legacy of successful management makes its sensible capital structure unsurprising. In a showdown of financial fortitude, IBM would trounce most businesses. However, when compared against the most profitable company ever, IBM loses this battle through no fault of its own.

Winner: Apple

Image source: Apple.

Durable competitive advantages

Although Apple and IBM enjoy identifiable competitive advantages, each company also has a weak point or two in their business models that investors should understand.

Regarding IBM's strengths, the company remains an absolute beast when it comes to R&D output. In fact, IBM was granted the most patents in the U.S. for the 23rd consecutive year in 2015. This commitment to research has allowed IBM to adapt and continually thrive in the constantly shifting world of technology. It's no accident that IBM has been able to leapfrog across generational shifts in technology, reorienting its business from punch card computers, to mainframes, to PCs, to servers and consulting, to its current focus on analytics, big data, and the like. It takes a truly special company to survive a single generational shift in the tech sector, so IBM's ability to continually remake itself for more than a century speaks to the company's strength in consistently developing and monetizing new technologies.

In terms of IBM's weaknesses, the shift toward cloud computing presents a new set of challenges for Big Blue. Cloud computing enables companies to more cost-effectively access computing power since companies no longer need to own their own servers and other computing hardware. While hugely beneficial for customers, this decreased cost of computing also lowers the switching costs between cloud software vendors to some extent, though major data migrations are certainly still a massive and risky undertaking.

Turning to Apple, the world's largest company clearly enjoys a few competitive advantages, the largest of which is its closed-loop operating system. Unlike Alphabet's Android OS, consumers can only access Apple's software and app ecosystem by buying the company's high-priced hardware. Using Apple services like iCloud, iTunes, and more creates something of a switching cost for consumers, though third-party applications like Spotify in music diminish this to an extent. Apple's comprehensive emphasis on design also reinforces its product's appeal against the competition. It's no accident that the overwhelming majority of iPhone users purchase another iPhone when they replace their smartphones. 

Furthermore, Apple's globally recognized brand is perhaps its single most valuable asset. Virtually unanimously agreed upon as the most valuable brand in the world, the Apple brand alone is worth an estimated $170 billion. Few brands, if any, can evoke the kind of emotional response Apple's does, and its repeated ability to define itself as more than just a technology company also helps support its high-margin business model.

At the same time, Apple is, at its core, a product-driven business and thus remains exposed to the usual risk factors facing a company that is always only as good as its next product. Apple's more recent upgrades have seemed somewhat incremental. The Apple Watch 2, iPhone 7, and MacBook Pro refreshes, for instance, all offered moderate improvements over their predecessors. However, Apple's ability to attract and retain tech talent and design talent still makes it highly likely the company will continue to churn out winning products for the foreseeable future.

Winner: Tie

Image source: IBM.

Valuation

Apple and IBM are mature, highly profitable companies. It should come as no surprise, then, that both Apple and IBM are each valued at a substantial discount to the overall market.

Company Name

P/E Ratio

Forward P/E Ratio

EV/EBITDA Ratio

Dividend Yield

Apple

13.4x

11.1x

8.3x

2.00%

IBM

13.2x

11.6x

10.4x

3.40%

Data source: Yahoo! Finance. 

Clearly, both companies are cheap. The question then becomes, are they too cheap? In each case, I think the answer is a clear yes.

Apple's top line may remain somewhat stagnant until the launch of the reportedly dramatic redesign of the iPhone 8 next year. However, the company continues to be an emerging capital return dynamo, giving Apple the ability to engineer bottom-line growth regardless of its top-line progress.

Similarly, IBM's business model transition will take years to complete. Replacing its current revenue base with sales from new businesses means its top line could stay flat at the IT giant for some time. However, like Apple, the company's outsized profitability also gives it the ability to deliver EPS and dividend growth regardless of its near-term top-line changes.

Winner: Tie

And the winner is...Apple

To be clear, I like both IBM and Apple stock right now. IBM shares are dirt-cheap at a time when the market as a whole looks anything but, and its business model pivot has clearly gained traction. However, Apple's moderately larger revenue growth story and greater financial resources give the Cupertino tech giant a larger degree of flexibility in terms of how it can produce sustained EPS growth in the years to come. So, while IBM looks like an attractive stock to buy, too, Apple shares appear to be the better buy today.