Walmart gets a lot of attention as the world's largest retailer. It's one of the most successful stocks of all time, and is part of various market indices ranging from the S&P 500 to the Dow Jones Industrial Average.

But the big investment banks and fund managers that pull the strings on Wall Street have thrown their money behind a different retail stock. Dollar General (DG -0.59%) has a much smaller investor following, but here is why the stock should command your attention.

Following the big money

You can read countless analyst reports from the big money firms, but where they invest speaks the loudest about how they feel. You can track the ownership breakdown of a public company's stock, seeing how much of the company is owned by mutual funds, institutions like banks and hedge funds, and individual stakeholders.

It's important to point out that the Walton Family, the heirs of Walmart founder Sam Walton, owns a collective stake in Walmart that's around half of the company, held through different entities like Walton Enterprises and Walton Family Holdings Trust.

Financial institutions and mutual funds own another 33%, which leaves about 17% for retail investors. Big money can only hold so much because of the Walton family, but 33% remains a meager figure considering that institutions control about 80% of the money flowing through Wall Street.

Compare Walmart to Dollar General, for example, where institutions and mutual funds control a whopping 95% of outstanding shares. Money managers have essentially bought up the entire company, which signals their feelings about the business.

Why the pros prefer Dollar General

Walmart has a reputation as the big bully in the retail world; the company does a staggering $576 billion in annual sales, which gives it enormous buying power with suppliers. It can buy and sell at lower prices than its competitors.

Ironically, though, Dollar General has demonstrated an apparent ability to run its business more profitably than Walmart has; its operating margin has remained nearly twice that of Walmart's over the past decade.

DG Operating Margin (TTM) Chart

DG Operating Margin (TTM) data by YCharts

You can also see that Dollar General is a fraction of Walmart's size; it's typically harder to maintain a high growth rate when you start getting as large as Walmart is. Dollar General has averaged 8.5% annual revenue growth over the past decade, compared to Walmart's 2.4%.

Is it the better buy today?

You can see below that Walmart's valuation has come back down after getting a bit higher than its mature and slower growth could justify. The companies now trade at roughly the same price-to-earnings ratio (P/E).

WMT PE Ratio Chart

WMT PE Ratio data by YCharts

But having the same valuation doesn't make both stocks good buys. Dollar General is growing faster and is more profitable than Walmart, yet the stock is valued at a P/E slightly below Walmart's.

Don't get me wrong -- Walmart is a blue-chip stock, and one that should be a solid contributor to any long-term portfolio. But it seems that the money managers of Wall Street prefer Dollar General, and it's clear why.