In recent years, many department stores have faced steep sales declines. This has been driven by a combination of consumer spending migrating online and people prioritizing spending on things that don't benefit department stores -- such as dining out or buying a new car.

Department stores catering to the middle class -- such as Sears Holdings (SHLDQ), J.C. Penney (JCPN.Q), and Macy's (M 1.44%) -- have been among the hardest hit. To cope with declining in-store sales, they have been closing numerous stores.

Macy's is closing lots of stores. Image source: The Motley Fool.

However, J.C. Penney has indicated that it is done with mass store closures. By contrast, Sears and Macy's seem eager to shut down stores faster than ever. This could help J.C. Penney in its efforts to regain market share.

Sears and Macy's close stores en masse

Sears has faced the longest string of sales declines among department store chains. As a result, it has closed hundreds of stores in the past few years across both the Sears and Kmart brands. It is in the midst of closing 10 Sears stores and 68 Kmart stores this summer, and the company has indicated that it will continue to aggressively close unprofitable stores.

Meanwhile, Macy's closed 36 stores earlier this year in response to a sharp sales downturn. Last week, it announced plans to shutter roughly 100 more stores -- about 15% of all Macy's full-line stores -- with most of those stores closing in early 2017.

J.C. Penney has also closed its fair share of stores in recent years: 33 in 2014 and another 40 in 2015. However, the chain has closed just seven of its stores in 2016 (less than 1% of the total).

Indeed, J.C. Penney's management now believes that store closures would hurt the company, not help it. Last fall, CFO Ed Record told analysts that when J.C. Penney exits a market, its online sales usually fall, too, as brand awareness declines.

J.C. Penney isn't interested in closing lots of stores anymore. Image source: The Motley Fool.

Two potential paths

Store closings can affect rival department stores in two different ways. On the one hand, every time a store closes, it puts a significant amount of sales up for grabs, allowing rivals to gain share.

For example, Macy's expects to lose about $1 billion in sales due to its upcoming store closures. (Some analysts think Macy's lost sales volume could be as high as $2 billion.) J.C. Penney may be able to capture some of these sales in its large mall-based store fleet.

On the other hand, sometimes the closing of a department store can cause an entire mall to fall into a death spiral. Across the country, mall traffic is falling, and the removal of an anchor store can lead to a sharp erosion of customer traffic, putting other mall tenants at risk.

J.C. Penney shares hundreds of malls with Sears and/or Macy's. Thus, it's legitimate to wonder whether a wave of store closures by those two rivals will hurt many of J.C. Penney's stores.

J.C. Penney isn't worried

There are clearly some places where a Macy's or Sears store closure will undermine the viability of an entire mall. This could force J.C. Penney to close some stores in the coming years.

J.C. Penney thinks it will continue to benefit from Sears' store closures.. Image source: The Motley Fool.

That's not the typical situation, though. In recent years, when Sears has closed a store in a mall it shared with J.C. Penney, sales have generally increased at the J.C. Penney store, according to CEO Marvin Ellison. The same pattern has also been observed for some of the recent Macy's store closures.

Additionally, J.C. Penney is trying to position itself to better capitalize on store closures at Sears in particular. It is in the midst of rolling out appliance sections in 500 stores, entering a category that has historically been one of Sears' strengths. As Sears continues downsizing, J.C. Penney hopes that appliance buyers flock to its stores instead.

Since the beginning of 2015, J.C. Penney has been one of the few department stores to post sales growth. As Macy's and Sears continue to reduce their retail square footage, it may create further opportunities for J.C. Penney to regain sales at their expense.