Wal-Mart (WMT -0.08%) was once the shining example of how to run a growing U.S. retail chain efficiently and profitably. Sam Walton built stores in cities and towns neglected by big-box stores, and once the company built the scale needed, it was able to squeeze suppliers to provide better prices and different products than its competitors. Combine that with a superior inventory management and distribution system, and you have a market-crushing company that beat Kmart, Target (TGT 0.18%), and others to dominate discount stores.

This strategy worked for more than four decades, but nothing works forever, and cracks have recently formed in Wal-Mart's foundation. Cost-conscious consumers have gone online, and consumers who have the ability and the cash to shop at brick-and-mortar stores are looking for more than just low prices. Target has taken design to the masses in everything from clothing to kitchenware, targeting a higher end of the market than Wal-Mart and gaining shares in the process. That focus has resulted in not only higher margins than Wal-Mart but also stronger growth in the U.S.

Target isn't the only one slowly eating away at Wal-Mart's retail lead. Costco (COST 1.01%) is outperforming Sam's Club by most measures, despite a bigger footprint. Then there's Amazon.com (AMZN 3.43%), which is taking share from everyone and is the new elephant in the room. 

Below I've laid out how U.S. sales at Wal-Mart, Target, Costco, and Amazon have changed since 2008. The growth rate in each column is for all of U.S. operations versus the year before.

 Brand

2009

2010

2011

2012

Through Q2 2013

2008-2012 Growth

Wal-Mart

6.8% 

1.1% 

0.1%

1.5%

1.2% 

10.3%

Sam's Club

5.6%

(0.4%)

3.5%

8.8%

1.4%

11.5%

Target

3.7% 

2.8% 

3.3% 

6.8%

2.4% 

17.9%

Costco

(2%)

4% 

7% 

7% 

6% 

26.1% 

Amazon

25.5%

45.6%

41.4%

28.4% 

25.5% 

231.9%

Note: Costco's 2013 growth is full fiscal year. Amazon's growth rate is for North American retail.

You can see that Wal-Mart has grown more slowly than each of these competitors over the past three-and-a-half years and is underperforming its competition in both discount and warehouse sales. Target was once the little brother Wal-Mart could brush off as a cute competitor, but the company has clearly shown that a focus on design and quality can overcome any price advantage Wal-Mart has.

More shocking to me was the fact that Costco grew 26.1% from 2008 to 2012, more than double the rate of Sam's Club. Costco is also larger than Sam's Club, with $97.06 billion of revenue last year versus $53.8 billion, so it's growing more quickly from a bigger base. Long term, this will eat away at Sam's Club's potential growth, just like Wal-Mart did to Kmart.

Online retail changes everything
I think it's clear that Wal-Mart is underperforming direct competitors Target and Costco, but Amazon is the biggest threat facing Wal-Mart. The dot-com company has fundamentally changed the way that customers shop and offers a great alternative for those shopping strictly on price, a place where Wal-Mart was once unbeatable.

It's not as if Wal-Mart didn't see online retail coming; it just doesn't have a great answer to it. Wal-Mart was built on a superior distribution network and lower operating costs than the competition, but it's built to serve brick-and-mortar stores. Amazon changed the game with giant warehouses and free shipping to individual customers. But the biggest differentiator may be that Amazon can aggregate many sellers through its online store and offer them space for rent in its warehouses. This allows Amazon to increase the number of products it offers without taking on the added burden of inventory. 

Wal-Mart has dabbled in this area, but in general it still owns the distribution center and the inventory. Amazon is making a fundamental shift in retail and Wal-Mart may not be agile enough to make that kind of shift.

A search for identity
One of the fundamental challenges facing Wal-Mart in competition against Target, Costco, and Amazon is that it's lost its identity. The concept that dominated rural America doesn't work in suburban or urban America, and as the company has adapted it's lost a single brand. Is the upscale-looking Wal-Mart in a nice suburb the one I should identify as Wal-Mart or is it the Supercenter that's full of cheap stuff?

Online is even more difficult. Amazon is the first stop for millions of customers, not Wal-Mart. Those habits are tough to change. Wal-Mart simply isn't identified as an online company, and Amazon will continue to eat its lunch if it can't make that shift.

Back to Kmart
Wal-Mart isn't yet on the brink of disaster like Kmart was in 2000, but the fall of Kmart was faster than most people think. They could see Wal-Mart coming, but with a 30% market share of discount store sales in 1990, they seemed to have a strong lead. As recently as 1999 and 2000, the company grew sales 6.6% and 3.1%, respectively. But the wheels were off by 2002, when sales dropped 14.9% and the company began closing stores. It's a cautionary tale about what happens to a retailer that stops growing.

Wal-Mart is on its fourth straight year of near-zero growth in the U.S. and same-store sales are slowly trending lower. Will it become Kmart? I don't think it'll see the rapid decline Kmart did, but it may be Wal-Mart and not Target or Costco that takes the hardest hit from online retail and the ever-changing consumer. That's a shift that seemed unthinkable a decade ago.