Value-oriented retailer Dollar General (DG -0.41%) has been through a rough patch since the COVID-19 pandemic began abating. After overestimating post-pandemic demand and clogging up stores with too much of the wrong inventory headed into 2023, the company has been booking heavy markdowns on tepid sales.

Investors have shared in this struggle, too. From their late-2022 peak to last year's trough, Dollar General shares fell nearly 60%.

There's a light at the end of the tunnel though. While overall sales still fell year over year for its recently reported fiscal fourth quarter, same-store sales were up a bit, reversing a couple of quarters' worth of weakness. Revenue of $9.9 billion also topped estimates of $9.76 billion, and per-share earnings of $1.80 were higher  than analysts' consensus of $1.72 per share.

Perhaps best of all, the company is looking for overall sales growth of between 6% and 6.7% this year, with same-store sales growth apt to roll in somewhere between 2% and 2.7%. This outlook suggests that the retailer's overhaul efforts are finally gaining some traction.

If you're searching for one more sign that you should take a chance on Dollar General stock, however, it actually comes from rival Dollar Tree (DLTR 0.04%). This competitor is retreating, with plans to close roughly 600 of its Family Dollar stores during the first half of 2024, and to shutter another 370 within the next few years.

Those displaced customers are going to go somewhere -- and Dollar General is the chain most similar and most geographically accessible to these consumers. Let's see what all this could mean for investors.

Dollar General is different where it counts the most

There is an alternative interpretation. That is, the market environment is so tough for discounters like Dollar Tree and Family Dollar right now that Dollar General can't be in a meaningfully better position.

That's not quite the actual case though. While these two companies (and three different store banners) certainly have their apparent similarities, they're all rather different behind the veil, so to speak.

Chief among Dollar General's competitive advantages is its real estate and subsequent reach. The retailer just opened its 20,000th store, with many of its newly built ones strategically located in smaller communities where competition from the likes of Walmart is light.

That's not to suggest Family Dollar doesn't have a respectable brick-and-mortar presence. It does. It operates at less than half of Dollar General's scale, however, with only 8,359 stores as of the beginning of February. The company has also demonstrated a slower pace of new store openings and remodels, giving Dollar General more opportunity to impress would-be shoppers.

Dollar General has also spent the last several years building strong in-house logistics capabilities. It now owns roughly 2,000 of its own tractor trailers, more than doubling its count from a year earlier. Pairing these trucks with its roughly two-dozen conventional retail distribution centers plus nearly another dozen distribution centers capable of handling chilled and frozen foods -- including fresh produce -- this retailer enjoys great flexibility and speed when it comes to handling inventory.

Its cold-storage facilities have proven incredibly important, too, allowing Dollar General to become more of a grocer that can not only compete with Walmart, but with grocers like Kroger as well.

Turnaround plans are starting to pan out

Don't misread the message. Dollar General still has its challenges. It's still rightsizing its inventory levels following their post-pandemic-reopening swell, for instance. Too many of its stores also remain habitually understaffed. On balance though, the company's once again got more going for it than against it as it shores these problems up.

Take inventory as an example. Dollar General spent the better part of 2023 cleaning up and clearing out the bulk of its inventory bloat. Although inventory values actually grew a little over 3% to just under $7 billion dollars and gross profit fell a bit during the recently ended quarter, the holiday quarter in question should mark the end of most of its inventory woes.

It's also been making investments meant to ensure they don't take shape again. One of these investments is in new inventory demand-forecasting technology.

Another investment is an additional $150 million worth of annual spending on in-store staffing largely meant to more efficiently handle goods once they're delivered to a store. While this initiative is taking a toll on the bottom line by virtue of last quarter's 5% increase in selling and administrative costs, it's an investment that should more than pay for itself in time. That's what the company's optimistic 2024 sales guidance suggests anyway.

That said, one must also wonder if operating both the Dollar Tree and Family Dollar brands under one roof has proven more complicated and less beneficial than hoped when the companies merged back in 2015. By retailing standards, the operations of the two different chains are more different than alike, after all. If nothing else, advertising either banner only goes half as far as it might were all of the company's stores one name or the other.

Take the news at face value

Dollar General was already planning to open on the order of 800 new stores this year, for the record, before Wednesday's announcement that Dollar Tree is aiming to shutter 600 Family Dollar stores within the next few months. Even assuming any of those Family Dollar locations become available soon, Dollar General isn't necessarily going to step in and use that space. It may not even want or need to, in fact, if a Dollar General store is already nearby.

Dollar Tree's impending Family Dollar closures do clear the path for an acceleration of Dollar General's longer-term expansion plans, however.

In the meantime Dollar General stands to gain new foot traffic in the near term just because hundreds of Family Dollar stores are on the verge of shutting down. There's more than enough value-oriented retailing business to go around. It just needs to be handled properly. Family Dollar isn't in a position to do that everywhere in every way that matters. Dollar General is, despite the stock's bearish response to Q4's results and the company's full-year guidance.

The market's reading this latest news the wrong way.