In his 1988 letter to shareholders, Warren Buffett said his favorite holding period was forever. Presumably, any stock that Buffett owns is one he believes will be successful for many more decades. Therefore, the Oracle of Omaha's investment in Wal-Mart (NYSE: WMT) -- the largest retail stock in Buffett's portfolio -- suggests that he's skeptical that Amazon.com (NASDAQ: AMZN) will put the crunch on the world's largest retailer in the years ahead. Although we cannot read his mind, Buffett seems to have reason to believe that Wal-Mart can compete with Amazon and compound shareholder value for years to come.

Logos from company websites. Image created by author.

Fears of obsolescenceAs the world's premier e-commerce company, Amazon is the biggest threat to traditional brick-and-mortar retail stores. In many ways, Amazon is the Wal-Mart of e-commerce. It sells virtually everything from books to electronics to snacks, and more. Amazon's wide product offering and free shipping for Prime members makes it the go-to website for many consumers.

Now, Amazon is rolling out same-day delivery in major U.S. cities, including a recent expansion of coverage in New York City, Washington D.C., and Philadelphia. Amazon guarantees that orders placed before noon will be delivered by 9 p.m. in select cities. It says there are more than a million eligible items. Prime members pay $5.99 for the service, while non-Prime customers pay $9.98 for the first item and $0.99 for each additional item.

Eventually, free same-day shipping may become the standard, just as Prime members currently benefit from free two-day shipping. Soon, it may be difficult to justify a trip to the store when you can simply order online and have it delivered to your door.

Everyday low pricesAmazon is a real threat to Wal-Mart's profitability, but investors may be giving the e-commerce giant too much credit for its competitiveness. For all of its convenience, Amazon still trails Wal-Mart on pricing. The City Wire reports that a 2013 study by Kantar Retail found that a diversified group of 59 products were, on average, 7% cheaper on Walmart.com than on Amazon.com and up to 16% cheaper in Wal-Mart Supercenters..

Wal-Mart's global footprint and $473 billion in annual revenue give it bargaining power with suppliers that Amazon has yet to replicate. Even with its everyday-low-prices strategy, Wal-Mart generates a 25% gross margin.. By comparison, Amazon generates a 15.5% gross margin if you divide the company's total cost of sales and fulfillment costs by Amazon's total net sales. The result, while imperfect, is a rough estimate of Amazon's profitability compared to Wal-Mart. Without the services revenue, Amazon might not even generate a gross profit. In other words, Amazon is already pricing its products as low as it can.

Anything Amazon can ship, Wal-Mart can ship cheaperOf course, many customers will gladly pay more for products if same-day delivery is an option. Amazon is positioned to be a leader in same-day delivery, but Wal-Mart has untapped potential to be the same. Wal-Mart's existing infrastructure could allow it to match Amazon's shipping options in cities and beat it elsewhere.

At the end of 2013, Wal-Mart had 132 distribution, return, and e-commerce fulfillment facilities. In addition, it has 3,300 Supercenters in the U.S. and 11,000 stores worldwide that are de facto distribution centers. While Amazon is capable of matching Wal-Mart's formal distribution footprint, it obviously will never match Wal-Mart's global store count.

Wal-Mart's ubiquitous stores could enable it to ship items more cheaply than Amazon. As a brick-and-mortar retailer, Wal-Mart already has a physical presence near its customers. Wal-Mart is already testing home delivery and a pickup window that allows Walmart.com customers to pick up their orders without the hassle of shopping. Amazon can build distribution centers in large cities, but it is doubtful that it can offer same-day delivery to customers who live in rural areas -- the bulk of Wal-Mart's customer base. If Wal-Mart leverages its store base to offer same-day delivery, it could match Amazon's offering in dense metro areas and beat Amazon in rural areas.

Moreover, Amazon's higher prices attract a middle-income demographic. Wal-Mart's core customer -- low-income rural citizens -- is unlikely to abandon the retailer for higher prices even if Amazon delivers better service. As long as distance remains a key component of shipping costs, Wal-Mart retains the advantage for these customers.

Foolish takeaway Warren Buffett rarely misjudges a company's moat, and there is little reason to believe that he has misjudged Wal-Mart's. Amazon represents a legitimate threat to retailers everywhere, but it cannot match Wal-Mart's proximity to customers. Amazon may win the battle for higher-income city dwellers, but Wal-Mart's low-income rural customer base remains uncontested. As a result, Wal-Mart shareholders need not fear Amazon's ambitious same-day delivery offering.

Leaked: Apple's next smart device (warning, it may shock you)Apple recently recruited a secret-development "dream team" to guarantee its newest smart device was kept hidden from the public for as long as possible. But the secret is out, and some early viewers are claiming its everyday impact could trump the iPod, iPhone, and the iPad. In fact, ABI Research predicts 485 million of this type of device will be sold per year. But one small company makes Apple's gadget possible. And its stock price has nearly unlimited room to run for early in-the-know investors. To be one of them, and see Apple's newest smart gizmo, just click here!

Comments from our Foolish Readers

Help us keep this a respectfully Foolish area! This is a place for our readers to discuss, debate, and learn more about the Foolish investing topic you read about above. Help us keep it clean and safe. If you believe a comment is abusive or otherwise violates our Fool's Rules, please report it via the Report this Comment icon found on every comment.