If you're familiar with the classic components of a Warren Buffett stock, you probably already know that Amazon (AMZN 0.73%) doesn't fit the mold.

Why is that? Buffett, the CEO of Berkshire Hathaway, usually favors stable dividend payers with a proven track record of delivering profits in good times and bad. He also likes stocks that trade below their intrinsic value. Historically, Buffett has also avoided tech stocks, saying he doesn't know how to value them, though that policy has eased in recent years.

Amazon has always been an expensive stock, and it's difficult to value according to conventional modeling because the company has diverse business lines and is constantly experimenting with new products and services. However, Amazon has grown to be one of the biggest companies in the world thanks to its strength in e-commerce and cloud computing, and Buffett has taken notice. He's lauded Jeff Bezos, the founder and chairman of Amazon, saying in 2016, "We haven't seen many businessmen like him."

Berkshire Hathaway began buying Amazon stock in 2019 under the direction of Buffett's deputies. At the time, Buffett called himself an "idiot" for not investing in Amazon sooner. As of the end of its second quarter, Berkshire owned 10.7 million shares of Amazon worth roughly $1.24 billion.

Though Amazon doesn't conform to Buffett's typical playbook, there's a clear reason he likes Amazon stock: the company's economic moats. Buffett is a big fan of moats -- what he calls sustainable competitive advantages -- and prioritizes them in his investing strategy. Let's take a look at a few of the economic moats Amazon has built for itself.

A winning loyalty program

Probably the best example of Amazon's competitive advantages is its Prime loyalty program. The company has signed up more than 200 million members around the globe for Prime, which gives them benefits like free two-day shipping, access to Amazon Prime Video, and discounts at Whole Foods among other perks -- all for $139 per year. 

Prime locks customers into the Amazon ecosystem, incentivizing them to spend more money on Amazon since they've already paid for free two-day shipping and free returns. Because of that, Prime members tend to spend significantly more money on Amazon than non-Prime members -- $1,400 a year, on average, compared to just $600 for non-Prime members.

The size of the membership base speaks for itself, and Amazon Prime is now the keystone of Amazon's e-commerce business, driving more than $20 billion in annual revenue.

A dominant cloud infrastructure business

While e-commerce business gets the bulk of attention from consumers and investors, most of Amazon's profits now come from its cloud computing business, Amazon Web Services. AWS has grown rapidly and delivered wide profit margins. In the second quarter, AWS' revenue grew 33% to $19.3 billion and it generated $5.7 billion in operating income, giving it an operating margin of 29%.

Amazon invented the cloud infrastructure business, storing data and running computing power for other companies remotely. Bezos has said that the company was able to get a seven-year head start over the competition because the cloud business started in-house, serving Amazon's retail side. 

AWS has become so successful because it gives companies computing scalability at a low cost, saving them time and money. Though AWS now faces a number of competitors, including Microsoft Azure and Google Cloud Platform, the company remains the leader in the sector, and its growth and profitability are signs of its competitive advantage.

A leader in customer satisfaction

What made Bezos' approach to retail unique was his focus on the long term and on putting customer satisfaction above all else. In fact, Amazon's mission is to be Earth's most customer-centric company. It regularly ranks near the top in customer satisfaction surveys, and that reputation for customer satisfaction has given it a key competitive advantage over rivals like Walmart, which has struggled in that category.

Amazon's strength in customer satisfaction helped make Prime a success, and gives the company an edge when it launches new products like Alexa devices. Customers who like shopping on Amazon tend to trust its products.

Buffett clearly recognizes that Amazon's customer reputation is an asset, saying in 2016 that Bezos has "taken things you and I've been buying and he's figured out a way to make us happier buying those products, either by fast delivery or prices or whatever it may be, and that's remarkable."

Though Bezos is no longer running the company on a day-to-day basis, Amazon's competitive advantages won't be easily undone. Expect Berkshire to be a long-term backer of Amazon stock, especially at its current price.