Everybody likes a strong corporate battle: Coca-Cola vs. Pepsi; Apple vs. Microsoft; or Twitter vs. productive work and family time. Wal-Mart (NYSE:WMT) and Costco (NASDAQ:COST) are the two leading industry players in the discount retail business, so let's compare these two companies and try to find out which one is a better purchase for investors.

Two very different retailers
Wal-Mart and Costco are very different retailers, each with its own strategy and business model. Costco's operations are entirely based on the warehouse retail model: The company makes most of its profit from membership fees, not from markups on product sales. This is a big advantage for customers, since it allows Costco to sell its products for razor-thin profit margins, sometimes even at a loss.

Costco is no small industry player by any means, but it's still less than one-quarter the size of Wal-Mart in terms of revenue. Wal-Mart has a sizable presence in warehouse retail through its Sam's Club division; however, the segment still represents a modest 13% of its total revenue.

Wal-Mart's main advantage is its gargantuan scale, not so much its business model. Wal-Mart operates over 11,400 stores around the world, and the company generated almost $486 billion in total sales during fiscal 2015. This massive size allows Wal-Mart to negotiate conveniently low prices and flexible payment conditions with suppliers, many of which owe their very existence to Wal-Mart.

Source: Wal-Mart.

Where Costco beats Wal-Mart
One area where Costco clearly beats Wal-Mart is customer satisfaction. Costco has ranked at the top of the American Customer Satisfaction Index survey in its industry every year since 2001. For 2014, Costco had an ACSI score of 84, comfortably above Sam's Club's score of 80. In the supermarkets category, Wal-Mart comes in way behind, as the retail giant has a satisfaction score of only 76.

Superior customer satisfaction and a smaller store base have allowed Costco to materially outperform Wal-Mart over the past several years, and recent financial reports confirm that this trend is still alive and healthy.

COST Revenue (TTM) Chart

COST Revenue (TTM) data by YCharts

For May, Costco announced a healthy 6% increase in comparable sales, excluding fuel price and foreign exchange fluctuations. For the 39-week period ended on May 31, adjusted comparable sales grew by an even stronger 7% year over year. 

Demand is particularly strong in international markets, and management believes it can expand the store base from 674 warehouses to 1,000 over the long term. While this sounds like an ambitious target, it's certainly not irrational, considering Costco's track record of performance.

Source: Costco.

By contrast, Wal-Mart announced a 1.1% increase in U.S. comparable sales for the quarter ended April 30, while its Sam's Club division -- which is arguably Costco's closest competitor -- delivered a smaller 0.4% increase in adjusted comparable sales. The company is finding a promising growth venue in its smaller neighborhood market store format: Comps in this division grew 7.9% in the last quarter. But Wal-Mart's overall financial performance is still no match for Costco.

Wal-Mart is much cheaper
Business quality and growth are crucial variables when it comes to making smart investment decisions. However, valuation is another major consideration. Wal-Mart is much cheaper than Costco at current prices, so the difference in business performance is already reflected in valuations to a good degree.

Wal-Mart trades at a P/E ratio below 15, which is a discount to the average valuation of around 19 for companies in the S&P 500 index. Costco, on the other hand, carries a premium versus both Wal-Mart and the overall market, trading at more than 26 times earnings.

The same goes for dividends. Wal-Mart has a 2.7% dividend yield versus a much more modest 1.1% for Costco. Wal-Mart has raised its dividend every year since paying its first quarterly dividend of $0.05 in March 1974, so it has proved its ability to deliver growing cash flows to investors through all kinds of scenarios.

Costco has a decade of consistent dividend growth under its belt, and the company has made generous distributions through special dividends over the past few years, but income-seeking investors would still be much better served by investing in Wal-Mart.

If you're looking for a solid, defensive dividend stock trading at an attractive valuation, Wal-Mart is the way to go. On the other hand, Costco offers superior growth prospects, and the company could easily continue outperforming Wal-Mart in terms of total return. If you're willing to pay up for quality, chances are Costco will deliver higher gains than Wal-Mart in the coming years.