At first blush, retailers Walmart (WMT -0.08%) and Dollar General (DG -0.41%) look enough alike. Walmart stores are far bigger, but there are fewer of them. There are far more Dollar General stores, but they're much smaller. Both companies sell the same basic consumer goods, though, even if Walmart offers more bigger-ticket items.

And yet, the two discounters are performing very differently. Dollar General's same-store sales (comps) slumped 0.1% year over year during the three-month stretch ending in early August, leaving the top line short of the $9.93 billion analysts were expecting.

Walmart's recently ended fourth quarter, conversely, topped revenue estimates of $160.3 billion and earnings of $1.71 per share with sales of $161.6 billion and a profit of $1.84 per share. Overall sales improved 5.7% year over year, leading to comps growth of 6.4% within the United States.

There are three differences separating the results of these two seemingly similar companies. Shareholders of both -- and Dollar General investors in particular -- will want to make sure they understand these disparate dynamics, since they could continue affecting both retailers for a while.

A more affluent customer base

It's often overlooked, but a company is more than its numbers. Investors are buying into a premise and competitive advantage as much as they're plugging into a business. Seemingly small details can make a big difference in certain circumstances.

First, take these two companies' differing customer bases in the current inflationary environment as an example. Nearly all consumers are struggling with higher costs right now. But inflation is hurting Dollar General's customers more. On average, they earn less than $40,000 per year.

After paying elevated prices for groceries, gasoline, and utilities, there's little to nothing left for any discretionary spending that Dollar General had once catered to -- there's little left for all the basic goods people need. Indeed, the company even said it trimmed its full-year profit outlook because its core customer remains "financially constrained."

Walmart customers are feeling a similar pinch. But the chain serves households with slightly higher earnings, so they aren't quite as cost-conscious as Dollar General's. During last month's earnings call, Chief Financial Officer John Rainey once again touted the fact that the company's stores are drawing more higher-income consumers since prices raced out of control.

Connect the dots: Walmart is able to serve customers looking to trade down; Dollar General isn't.

More muscle with suppliers

Second, another dynamic working in Walmart's favor is its sheer scale, which provides leverage when negotiating prices with suppliers and vendors.

For the better part of last year, Walmart -- the world's biggest retailer -- either absorbed higher wholesale prices or passed them along to its shoppers. In early 2023, though, Walmart made clear it was done accommodating price increases from its suppliers. It is too important a retail partner to test, so the hardball approach appears to have worked. Its customers are enjoying palatable prices, while the company is still turning a tidy profit.

Dollar General does enjoy relationships with suppliers that allow its stores to offer custom-size (and custom-priced) name-brand goods. But it's around one-tenth the size of Walmart's U.S. operation, so it just isn't able to flex the same muscle against suppliers' price hikes.

Tighter inventory controls

And third, although there are advantages to operating more than 19,000 stores in relatively less-populated markets, Dollar General's strategic flaws are starting to become evident. It's difficult to monitor and manage this many stores, regardless of their size. Complaints of understaffed stores are common. There are citations and fines for cluttered stockrooms, which apparently aren't regularly inspected by management.

This sprawl is at least part of the reason already-bloated inventory levels swelled another 3.4% year over year last quarter. It's possible that sales were lost simply because merchandise was in a stockroom rather than on a store shelf, or perhaps waiting in a warehouse or on a truck.

Although Walmart stores and stockrooms are clearly bigger as well as busier, with only 5,215 stores in the United States, it's easier to manage its inventory.

Walmart is worth owning now, while Dollar General isn't

None of these dynamics are permanent. Just a decade ago, Walmart store shelves were frequently bare, without an employee anywhere in sight. That's when Dollar General began a massive expansion effort, which was well-received due to its well-kept and well-staffed stores in underserved markets. So change has happened before, and it can happen again.

Evidence of such a shift is nowhere in sight though. And while inflation rates are falling, prices are still rising from frothy levels. Meanwhile, August's jobs report showed a surprising increase in the nation's unemployment rate -- from 3.5% to 3.8% -- on relatively modest payroll growth of 187,000 jobs.

Job openings also fell to more than a two-year low last month, according to numbers from the Bureau of Labor Statistics. The data suggests more people fighting for fewer jobs, possibly willing to accept lower pay as a result. In the meantime, the two retailers' organizational structures aren't apt to change anytime soon, continuing to make things tricky for Dollar General's more-complicated operation.

There's something of an argument to be made for stepping into Dollar General shares here in hope of a turnaround. The problem is, there's no reason to expect a meaningful recovery anytime soon. Walmart, meanwhile, is firing on all cylinders, capitalizing on the current economy.