On the surface, Amazon (AMZN -1.45%) stock may look expensive. Shares trade at 41 times earnings. But a look beneath the hood shows a number of reasons why the stock easily lives up to its premium valuation.

Here are some of the main reasons investors may want to consider adding shares of the e-commerce and cloud-computing giant to their portfolio today if they don't already own it.

Gushing with cash

Sure, Amazon's $1.8 trillion market capitalization might seem overwhelming to some investors looking into the stock. But the company's underlying cash flow helps justify this valuation. For instance, the company's trailing-12-month operating cash flow came in at an astounding $108 billion. This huge cash-flow stream enables enormous reinvestment in its business while still producing substantial free cash flow. Total trailing-12-month free cash flow, less principal repayments of finance leases and financing obligations, was $53 billion.

Amazon's price-to-adjusted free-cash-flow multiple of 34 is much easier to embrace than its price-to-earnings multiple of 41.

A lucrative cloud-computing business

Still, even a price-to-adjusted free-cash-flow multiple of 34 may seem a bit pricey for a company that grew its total revenue by only 10% year over year in its most recent quarter. But an overview of Amazon stock is incomplete without understanding how important its cloud-computing business, Amazon Web Services (AWS), is to the company. Coming in at 16% of trailing-12-month sales, some investors may make the mistake of concluding the segment is of small importance to Amazon's overall business. But this couldn't be further from the truth.

First, investors should note that AWS is growing faster than Amazon's overall business. This means it will grow as a percentage of revenue over time. Consider that AWS revenue rose nearly 19% year over year in the second quarter.

Second, AWS is far more profitable than the rest of Amazon's business. AWS's operating income in Q2, for instance, was $9.3 billion. This gives the segment an operating margin of greater than 35%. Even more, this segment accounted for about 63% of total operating income. This means that as AWS grows, it will have an outsize impact on Amazon's profitability.

Amazon CEO Andy Jassy emphasized the importance of AWS in the company's most recent earnings call, noting that none of the progress it is making in cloud computing is especially noteworthy. "AWS continues to be customers' top choice," Jassy said in the company's second-quarter earnings release.

Of course, it's no surprise that AWS remains a top customer choice. The company's market leadership in cloud computing gives it scale and cost advantages, helping it reinvest aggressively and innovate rapidly.

Amazon's scale in cloud computing is difficult to overstate. Synergy Research Group estimates that AWS commands nearly a third of the worldwide cloud infrastructure market share, with Microsoft's Azure coming in second -- about six percentage points behind.

Once investors realize the significance of AWS as a growth engine for Amazon, fundamentals start to justify the stock's current valuation.

A wide moat

The final key factor helping the bull case for Amazon stock in a big way is the company's competitive advantage: scale. As both the world's largest e-commerce retailer and cloud-computing infrastructure provider, the company's overall scale is a competitive advantage in and of itself.

Put another way, the company is able to spread its fixed costs across a larger number of customers than its peers, spinning its flywheel faster so it can invest more aggressively than its competitors and expand its economic moat even further.

Considering Amazon's significant cash flow, its fast-growing and lucrative cloud-computing business, and its scale competitive advantage, shares look like a good buy today. Of course, there's always a chance that the company's edge in retail and cloud computing will erode over time and that Amazon's future isn't as bright as expected. But this risk seems small, given the company's long history of growing rapidly, expanding profitability, and maintaining market share leadership.