Most of the time, companies are more or less what they were five years ago, as well as what they will be five years from now. Oh, they may get slightly bigger, but that's often largely a byproduct of inflation and resilience. Not a whole lot's actually changing with the businesses themselves. That's not quite the case for discount retailer Dollar General (DG -0.41%).

Dollar General is in the midst of a sweeping transformation that should be good for shareholders. But it's also experiencing growing pains that are working against the stock. For better and worse, most of this reinvention will be over five years from now, by which time the overarching investment thesis for this company will have changed.

The bigger it gets, the more unwieldy it becomes

On the off chance you're reading this and aren't familiar, Dollar General operates over 19,000 relatively small discount general merchandise stores peppered across the United States. More than two-thirds of them are found in communities with populations of less than 20,000 -- places where larger-footprint retailers such as Walmart and Target generally don't make an effort to establish a presence. In many cases, Dollar General may place more than one store in a single town. Although they are not truly grocery stores (they stock a select assortment of groceries), they can also compete with nearby grocery stores.

More to the point, Dollar General stores fill a void. They offer people the most important consumer staples they need and are placed near where their customers live.

And the company has leveraged the daylights out of its position. Five years back, it was operating just under 14,800 stores. Now it has 19,104 -- and nearly 19,300 if you count its non-Dollar General storefronts. That's a roughly 30% jump in stores. Now it's doing $38 billion worth of business annually, versus a little over $23 billion in annual revenues then. The new stores helped, but the addition of more groceries -- including perishables -- helped as well.

DG Revenue (TTM) Chart

DG Revenue (TTM) data by YCharts.

Look for more of the same sort of expansion in the immediate future. Despite economic turbulence and a few in-house headaches like staffing woes and inventory challenges (too much inventory, to be precise), the discounter still plans to open more than 1,000 new stores this year, maintaining its recent cadence of growth. Even if that pace slackens in the future, Dollar General could easily be operating over 22,000 stores by 2028. At that point, its top line could easily eclipse $44 billion, boosted by inflation.

Investing in fixes

It's arguable, however, the company's focus on adding more stores has distracted it from keeping close tabs on the ones it already operates.

Since 2017, the Occupational Safety and Health Administration (OSHA), a regulator for the U.S. Labor Department, has fined the retailer more than $21 million for 240 violations of safety protocols such as the obstruction of fire exits and electrical hazards. That's an indictment of what's actually happening within the company's stores that shouldn't be happening. Or, perhaps it's more accurate to call it an indictment of what's not happening that should be. Too many Dollar General stores are perennially understaffed, a condition that can often lead to inventory pile-ups on and off the sales floor.

The retailer's finally starting to address both matters. Management intends to invest an additional $100 million in its stores this year, both to increase staffing and to get its stores up to acceptable standards of repair and maintenance, and keep them there.

These aren't problems that will be solved quickly with mere money, though. It will take time -- perhaps even a full five years -- and ground-level work to restore Dollar General's tarnished reputation to what it was before management became hyper-focused on expanding its store count. That's obviously working against the stock's price in the interim.

Is Dollar General stock worth the five-year wait?

The irony is, by the time Dollar General fixes the issues that currently ail it the most, it will be running into a systemic headwind.

Based on an estimate of at least 22,000 stores and a top line of $44 billion in five years (and presuming Dollar General's additional investments in stores and staff have the desired effects), its typical operating profit on the order of $3.3 billion and net income of $2.4 billion could swell to around $4.0 billion and $2.9 billion, respectively. Not bad.

Chart showing the persistent sales and earnings growth expected of Dollar General through 2027.

Data source: StockAnalysis.com

However, at that point, Dollar General may truly find it's running out of well-suited rural and non-urban places to put new stores.

The U.S. Census Bureau reports that of the nation's 19,500 recognized, incorporated towns, fewer than 15,000 had populations of under 5,000 people. Those towns are Dollar General's proverbial bread and butter. There are already enough Dollar General stores for all of them. Adding locations in these small towns could start diluting the revenues of its already-existing stores.

Meanwhile, although its more urban-oriented pOpshelf chain seemingly represents a robust growth opportunity, bear in mind that the larger markets it will be competing in are already well saturated with Targets, Walmarts, and other retailers. Growth won't come easy on this front either.

This backdrop doesn't spell doom for Dollar General, nor does it point to disastrous returns from Dollar General stock. Indeed, a less aggressive expansion plan would not only conserve cash but would also allow management to focus more on execution at the store level.

The ultimate end here, however, is a transition from being less of a growth-oriented company into more of a cash cow. Dollar General can certainly be a great cash cow, by virtue of operating in markets where there is little to no real competition. The stock, however, will also be priced more like a slower-growth value stock. Its reliable dividend will be the key reason to own it.

Bottom line? Given that its stock still trades down by 35% from November's high and is priced at less than 16 times next year's expected earnings, there's enough risk-adjusted upside from here to bet that the next five years will at least be more bullish than the past year has been. After that, though, you'll want to revisit your investment thesis and see if you want to continue holding it. Dollar General's not going to remain a growth story forever.