Jul 28, 2015 ยท 5 minutes

Two weeks ago, Amazon had its 20th birthday.

If the Prime Day sales Amazon offered by way of celebration left many underwhelmed, the occasion left little question about the amazing accomplishment of building not just the world's biggest ecommerce company but also what is perhaps its most successful retailer.

A week later, Amazon ticked past a much more pedestrian milestone: its financial earnings report for the three months through June 2015. And if Prime Day was about how brilliant Amazon's past has been, the earnings report was notable for offering a glimpse into how bright the company's future looks. Which is to say, pretty bright indeed.

What was notable wasn't so much that Amazon's stock has risen more than 10 percent since the report, or that it propelled its market cap above that of slumping Wal-Mart. It was that even a lot of investors and analysts who had been concerned about heavier spending while its core business is slowing were now willing to concede that the company has a strong handle on its future growth.

"For some time, we have believed that Amazon margins would grow slower than bullish expectations and had been concerned with a deceleration in revenue,” wrote Barclays analyst Paul Vogel as he boosted his rating on the stock and elevated his price target to $700 a share from $412 (Amazon is trading around $531). “Clearly, we have been too pessimistic... as margins are expanding much faster than we thought."

The shift in thinking about Amazon's future has to do with a debate that has slowly burned for years about Jeff Bezos' ability to use profits from older businesses as leverage to invest in new initiatives. For years, the free two-day shipping for Prime subscribers has eaten into margins. As have the cost of building an infrastructure that could scale up as Web Services grew. As have investments in dozens of fulfillment centers in the US and abroad. Will they translate into new growth?

It better, because the spending has pushed Amazon into red ink in recent quarters. Even when the company is profitable, the profit is so razor thin that Amazon ends up with a ridiculous PE ratio. (Like right now. Amazon is trading at 454 its estimated 2015 earnings). Bulls have long argued that PE's don't measure Amazon well given its business model, which invests as much as it can in future growth.

In other words, while tech giants these days all aspire to think like startups, Amazon has always invested like one: putting whatever resources it can into new areas, new markets, new technologies. Even if it meant posting a net loss of a negative cash flow for a few quarters at a time. On this broader point, the bulls have pretty much won the debate. Amazon has proven naysayers wrong for at least the past 15 years.

For this reason Amazon has always guided investors to look not at its net income but its free cash flow – basically, cash generated from its operations minus purchases of property and equipment. But in the past year or so, a problem emerged: Amazon was seeing negative free cash flow as it spent close to $5 billion a quarter on property and equipment.

At the same time, there were two other concerns. The first was that media sales – the heart of the Amazon store and its oldest retail channel – were slowing in the US and abroad. The second was that new initiatives weren't making up for that slowdown. The Amazon Phone was a bust. The Echo seems like a costly curiosity. And a price war in cloud infrastructure services was not long ago seen to be bad news for the profit potential of Web Services.

While there is always a danger in extrapolating from one quarter, the numbers that Amazon offered last week argue that these concerns may be overblown. Media sales are in fact slowing – up 6 percent in the US and up 3 percent internationally (excluding the impact of a strong dollar). But they are more than offset by the larger electronics and general merchandise category, which saw revenue rise 32 percent in the US and 31 percent internationally. Many ecommerce companies would be thrilled to have 30+ percent revenue growth.

Web Services, meanwhile, is proving to be an excellent area to get returns on Amazon investments. The division has brought in $6 billion in revenue during the past year and is growing at an annual rate of 81 percent. As for the predictions that Web Services would lose money, they were wrong. Operating margins have grown to 22 percent last quarter from 8 percent a year ago.

The growing profitability of Amazon's cloud business is interesting: It argues that even as the prices for cloud services from rivals like Microsoft, IBM or Google are falling, the market itself isn't yet commoditized. It may be that Amazon is offering something with Web Services that customers are willing to pay a premium for. Or that the cloud isn't a zero-sum game, where faster growth by, say, Microsoft doesn't translate into slower growth for Amazon.

Either way, Web Services is one of the two areas helping Amazon to pad its margins as it spends heavily in other areas. The other area is Amazon Prime, which now has about 44 million members – and quite possibly more if the Prime Day event inspired people to sign up. At $99 per member, Amazon gets $4.4 billion a year from Prime alone, offsetting its discounts and delivery costs as well as subsidizing new fulfillment centers.

As a result, while Amazon's margins may remain razor thin at the net-income level, gross margins are rising – to 35 percent last quarter from 31 percent a year ago. People may compare Amazon's puny net income to WalMart's, but Amazon's gross margins are substantially higher than those of WalMart's (35 percent versus 25 percent). The puny net income isn't because Amazon's stores are less efficient – if anything, the gross margins show they're more efficient – it's because Amazon is investing all it can into the future.

“The company is an example of what can happen when a company invests in the future and ignores short-sighted criticism from Wall Street,” Josh Brown noted in a good summary of Amazon's earnings. “The stuff Amazon had been spending money on for years is now paying off in a big way.”

Even that isn't the biggest takeaway from Amazon's results last quarter. Yes, Amazon is investing in future growth as Bezos has been explaining in his shareholder letters for years. What's new here is Amazon showing the ability to ease back on the accelerator when it needs to. If projects fail or growth in older business slows, Amazon can adjust its capital spending to shore up profits. That's important when employee compensation relies on the price of Amazon's stock.

Of course, the question is whether this can last. Some analysts remain skeptical, and this quarter may end up being a fluke. But if it isn't, Amazon will be the rare company with the best of both worlds: the dominance and success of a $250 billion tech giant, and the luxury to keep spending on future growth the way a startup does.