Economic headwinds took a toll on Amazon (AMZN 3.20%) last year. Revenue growth slowed as high inflation suppressed both consumer discretionary spending and corporate expenditures, and its profitability deteriorated as rising costs cut into its margins. Those headwinds ultimately caused Amazon to report its first loss since 2014. But the situation may get worse if the U.S. economy slips into a recession, which the Federal Reserve thinks is likely to happen this year.

While Amazon returned to profitability in the first quarter of 2023, the stock is still down by about 44% from its peak. Aside from points within the current Nasdaq Composite bear market, its share price has not been down more sharply at any point in the past decade. That means patient investors have a once-in-a-decade opportunity to buy the FAANG stock.

Here's why that would be a smart move.

Amazon is gaining market share in e-commerce

Amazon operates the most popular online marketplace in the world. It receives nearly four times as many visitors as the next closest digital shopping destination, and that scale is the source of a powerful network effect. Sellers naturally gravitate toward the platform with the most buyers, and buyers naturally gravitate toward the platform with the best selection (i.e., the most sellers). Amazon reinforces that network effect by providing fulfillment services to sellers and Prime membership benefits to buyers, both of which make its marketplace stickier.

That strategy has paid off in a big way. According to eMarketer, Amazon will account for 38.7% of online retail sales in North America and Western Europe this year, up from 38.2% last year. In other words, it's still gaining market share in e-commerce. That puts the company in an enviable position. Global e-commerce sales are expected to grow at a nearly 9% annualized rate through the end of the decade, according to Research and Markets.

Amazon is gaining market share in digital advertising

Success in retail has paved the way for Amazon to build a booming digital advertising business. Its marketplace not only engages consumers, but also generates lots of shopper data, and both qualities make it a valuable advertising partner. In fact, Amazon accounted for 6.7% of global digital ad spend last year, making it the fourth-largest seller of digital advertising space. And according to eMarketer, Amazon will surpass Alibaba to claim the No. 3 spot in 2023, and will attract 8% of global digital ad spending by 2024.

Investors have good reason to believe that momentum will continue in the subsequent years. Retail marketing is the second-fastest-growing advertising format in the U.S., and the Amazon brand is synonymous with retail. That puts the company in a good spot. Ad tech spending is expected to increase at a 14% annualized rate through 2030, according to Grand View Research.

Amazon is the market leader in cloud computing

Amazon Web Services (AWS) was the first hyperscale public cloud and it still holds the leading share of the market. It accounted for 32% of cloud infrastructure and platform services (CIPS) spending in the first quarter, and consultancy Gartner recently recognized AWS as the CIPS leader for the twelfth consecutive year. That success stems from an unmatched portfolio of cloud services and an unparalleled capacity for product innovation.

To quote Gartner, AWS offers the "greatest breadth and depth of capabilities of any provider in the market for CIPS." That bodes well for Amazon. The cloud computing market is expected to grow at an annualized rate of 14% through 2030, according to Grand View Research.

Amazon stock is trading at a discount

Amazon has strong positions in e-commerce, digital advertising, and cloud computing, and all of those markets are forecast to expand quickly through the end of the decade. But Amazon should be able to outpace the industry average in each case due to its competitive advantages. That makes its current price-to-sales multiple of 2 look cheap, and it's certainly a discount compared to its five-year average multiple of 3.6.

As a caveat, Amazon may struggle in the coming quarters, especially if the U.S. economy slides into a recession. But I think patient investors who buy this FAANG stock today will be rewarded down the road. Economic turbulence is temporary. The U.S. economy has endured many recessions in the past, and it will struggle through more in the future. But Amazon has a healthy enough balance sheet to survive an economic contraction, and its scale, brand authority, and innovative capacity should allow it to thrive on the other side of any downturn. That's why this stock is worth buying and holding for the long term, even if the U.S. economy winds up in a recession this year.