FORTUNE — In retail, being your own worst enemy isn’t always a bad thing.
On Tuesday, Walgreen Co. announced plans to close 76 unprofitable drugstores by August.
The Deerfield, Ill.-based company, which reported that its second-quarter net income inched down from $756 million to $754 million, said the closings would save it at least $40 million by fiscal year 2015. The closures will be spread across the country, with the most — 20 — in the Northeast. Walgreens (WAG) is the largest drugstore chain in the U.S., with 8,210 drugstores nationwide — 138 more than a year ago.
So what’s behind those 76 closures?
During its Tuesday earnings call, when the company addressed its rationale for the closings, it listed store density first. Walgreens CEO Greg Wasson explained that some of the stores set to close are in the same area as other Walgreen locations.
MORE: Fed: Taxpayer subsidy for ‘Too Big To Fail’ banks? $8.5 billion
In these markets, the drugstore is, essentially, cannibalizing itself.
We’ve seen this before.
Starbucks (SBUX), for instance, suffered through a similar bout of over saturating its own market. (Those jokes about the coffee chain opening a Starbucks inside an existing Starbucks weren’t far off.) In 2008, the Seattle company announced the shuttering of some 600 stores — 70% of which had opened in the two years prior. The company told its investors not to worry — lost revenue from the closed stores would likely be recovered by nearby Starbucks.
Why, exactly, does this happen? If you’re a retailer looking to expand, aren’t you well aware of where you have existing locations? Isn’t it a good idea to refrain from opening a new store in a geographic area where the fiercest competition is yourself?
Often, these redundancies result from mergers and acquisitions, says Garrick Brown, director of research at Cassidy Turley, a commercial real estate services company. When one retailer acquires another, there will likely be duplicate locations and only one will survive.
Walgreens has made some giant acquisitions in the past few years. It purchased Kerr Drugs in 2013, USA Drug in 2012, and Duane Reade in 2010 — deals that added 477 locations to Walgreens’ geographic footprint. Sometimes, also, investor pressure for year-over-year growth can drive too much expansion with too little due diligence, says Brown.
In other instances, the over-saturation is entirely deliberate.
When retailers enter a new market, their strategy is to be on the “corner of Main and Main,” says Greg Maloney, president and CEO of Jones Lang LaSalle’s Americas retail group, which counts Walgreen Co. as a client. “They hire a broker to finds sites and say, ‘We want the best locations, the best corners,’” he says. It’s very likely that a market’s best locations are in the general vicinity of each other. Maloney adds, “They think, ‘If we open in those locations, yes, the long-term strategy may result in cannibalization, but look at the brand visibility we’ll get!’”
MORE: Spain takes to the thrift shop
When a retailer enters a new market, priority No. 1 is to get its name out there. A good way to do that is by plopping a store on every high-traffic corner. It’s an expensive and risky strategy, Maloney says, but one that can pay off, especially for retailers that are not necessarily destinations, but instead benefit from impulse shopping trips. You deliberately schedule a trip to Lowes; you pop into a Walgreens for toilet paper because it’s conveniently located on the way.
And in the end, if a retailer decides to shut down some of those “Main and Main” store locations, it still controls that nice plot of real estate. They can always keep competitors out if they want to, Maloney says.
Walgreen & Co. spokesperson Michael Polzin told Fortune on Wednesday that the biggest factor in the closures is the change in demographics across the country over the past decade. (The stores that are being closed are, on average, 10 years old.) “Over time, you look at trade areas and how the population moves around,” Polzin says. Those changes, he argues, plus little changes like road construction, can affect customer density and result in lower sales.
Polzin, of course, emphasized that Walgreens has seen tremendous growth in the past decade. It had 1,500 stores in 1990, 3,000 stores in 2,000, 4,000 by 2004, and 7,000 by 2012. Of the 4,000 locations Walgreens added in the past decade, “we might have over-stored in a few places,” he says.