Electronics giant Apple (AAPL -0.35%) and e-commerce platform Shopify (SHOP 1.11%) have been big winners over the past five years. They've returned 355% and 387%, respectively, easily outperforming the stock market by a ratio of roughly 4-to-1. That shouldn't be a surprise. Some 2 billion people use Apple's iOS devices, and Shopify's e-commerce platform has helped online shopping become a way of life in modern society.

But that was then. You want to know about the future. Can both stocks keep their momentum up? And which is the better stock to own now? Let's take a closer look.

How much are investors paying for cash profits?

Apple and Shopify have little in common. One company makes and sells personal electronics; the other is a software company with a platform that helps merchants sell things online. However, free cash flow is the common trait that links all companies.

AAPL Free Cash Flow Yield Chart

AAPL Free Cash Flow Yield data by YCharts

Cash is the blood and oxygen circulating through a company, arguably the most important thing investors want to see. The critical question is: How can you invest your money to generate as much cash flow in return as possible? A company producing increasing cash flow will grow earnings, repurchase shares, pay dividends, or invest in growing the business -- all good things!

Apple and Shopify generate cash flow although Apple's massive size stands out. It generates more free cash flow in a year than what Shopify's entire company is worth. But there's more to it. Investors should look at how much cash flow their money is buying.

Apple stock is offering just over $0.03 of cash flow for every dollar of market cap at its current share price. That's a free-cash-flow yield of 3.3%. Shopify offers much less, a yield of just 0.5%. Off the jump, Apple stock is offering more bang for your buck.

Adding some color to this picture

But context is important because investors must also understand the dynamics around each company. Is there a reason investors aren't paying more for a piece of Apple's cash profits? A closer look reveals that Apple's become so big that it's struggling to grow.

According to analyst estimates, Apple's annual revenue growth could average 3% to 7% for the next three years, and earnings could compound at 8% to 10%. Shopify has higher expectations; revenue could grow 20% annually, and earnings could compound at more than 30%.

Long story short, people pay a premium for Shopify because the company is growing more rapidly. Apple may be arguably the most influential company on Earth, but it's also massive and might not produce the stellar investment results it once did.

What's the verdict?

If everything else were equal, investors would be wiser to take the faster-growing company in Shopify. The above discussion highlighted that. However, the price you pay for a stock matters.

Shopify's 0.5% cash-flow yield is low enough to be problematic. Even if the company's cash flow doubles yearly, it would take several years to come close to what Apple offers today. In other words, the market could be overpaying for Shopify's growth.

That huge value gap is why investors should consider Apple the better stock to buy until Shopify's valuation becomes more reasonable. Apple may have slower growth, but it's proven remarkably durable, and its nearly $100 billion in annual free cash flow is a war chest for creating shareholder value. That can enhance Apple's organic growth, a button Shopify can't currently press.

Ultimately, both stocks are great investments at the right price, but Apple holds the edge today.