Shares of Wal-Mart (NYSE:WMT) stock are up barely 5% over the past 12 months -- a disappointing record for a company that's supposed to be the 800-pound gorilla of the retail world. Yet here's something you may not have realized: Wal-Mart stock is actually outperforming shares of Amazon.com (NASDAQ:AMZN), the online giant that's trying to upset Wal-Mart's empire.

And here's something else you might not know: Right now, today, Wal-Mart stock just might be a "buy." And now, I'll tell you why.

Wal-Mart stock is cheap
Valued by the traditional price-to-earnings metric, Wal-Mart stocks stacks up well against megarivals such as online retailer Amazon, and physical-world wholesaler Costco (NASDAQ:COST) as well. With a trailing P/E ratio of less than 18, Wal-Mart stock sports a valuation just 60% that of Costco and is infinitely cheaper than (currently unprofitable) Amazon.com as well.

Of course, analysts do expect Amazon to earn a profit next year. But even assuming they're right about that, here's how the stocks' valuations compare based on forward earnings estimates:

G 

Source: Finviz.com

And that's assuming that Amazon's profits materialize as promised. Which they may not.

Wal-Mart stock benefits from low expectations
What explains investors' willingness to pay such high multiples for Amazon's prospective profits, yet so little for Wal-Mart's? Largely, this is a function of investors' trust that Amazon will grow much, much faster than Wal-Mart in future years. (And faster than Costco, too). To illustrate, here are analysts' projected long-term growth rates for the three rivals, as restated by finviz.com.

Www
Source: Finviz.com.

With its projected growth rate of 39.7% -- annually -- over the next five years, analysts are expecting Amazon.com to outgrow Wal-Mart (5.7%) by sevenfold. For that matter, Costco's projected growth rate of 11.1% is nearly twice as fast as what analysts expect Wal-Mart to produce. Yet according to Yahoo! Finance figures, the average retailer in America is expected to grow earnings at better than 16% annually over this same period.

So if Wal-Mart is truly the biggest and baddest retailer out there, what are the chances it's going to let everyone else in the industry run circles around it? Put another way, what do you think will happen to Wal-Mart's stock when the company proves it can actually grow faster than single digits? Because here's something you may not know about Wal-mart, and the analysts who follow it:

They're usually wrong.

According to data from StreetInsider.com, over the past four years, Wal-Mart has "beat earnings" -- grown faster than the analysts thought possible -- no fewer than 10 separate times. That's more than twice as often as the company has "missed" quarterly earnings. What's more, thanks to its immense cash-producing prowess, Wal-Mart has the ability to grow its earnings faster than analysts expect, even when it doesn't "grow" much at all. Last year, Wal-Mart authorized the repurchase of $15 billion shares-worth of its own stock -- about 5% of the share-count. And every time Wal-Mart buys back a share, and takes it off the market, that's one share fewer among which Wal-Mart must divvy up its profits. So even when earnings are par for the course, the company can add value for investors through buy-backs.

And Wal-Mart shows you the money
That's why Wal-Mart's cash flow is so very important: GAAP earnings and GAAP earnings projections are all well and good, but when you get right down to it, what matters most to investors is whether their companies can produce cash profits on their investments. And it's here where Wal-Mart really excels, generating $13.6 billion in cash over the past 12 months, according to S&P Capital IQ.

Measured by dividing a firm's market capitalization (the price you pay for Wal-Mart stock) into its free cash flow (the money your investment generates for you), the free cash flow yield at Wal-Mart is a strong 4.91% today. Simply put, for every dollar you invest in a share of Wal-Mart stock, you can expect the firm to generate nearly five cents' worth of real, cash profits.

WMT Free Cash Flow Yield (TTM) Chart

WMT Free Cash Flow Yield (TTM) data by YCharts.

That 4.91% is more than one and a half times the free cash flow yield at Costco. It's more than seven times the free cash flow yield at Amazon.com

In years to come, this is cash that Wal-Mart can use to boost its dividend payout -- which, at 2.3%, is already more than twice what Costco pays its shareholders. (Amazon pays no dividend at all.) Wal-Mart can also use its copious cash flows to buy back shares (increasing the size of your stake in the company for every share it takes off the table), or to reinvest in its business, potentially putting the lie to analysts' expectation of single-digit growth. Whichever use it puts the cash to, though, the simple fact that it's churning out more and more cash with each passing year is already good news for investors.

And it's a great reason to buy Wal-Mart stock.

Rich Smith has no position in any stocks mentioned. The Motley Fool recommends and owns shares of Amazon.com and Costco Wholesale. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.