With Macy's  (M - Get Report) recent announcement that it will close 100 stores, many investors are left wondering what is next for the retail giant.

Because Macy's is the largest department store operator in the U.S., this is a big deal. The store closings will put many employees out of work and deprive malls of all sizes of their anchor tenants.

However, this wasn't a surprising decision by Macy's.

Americans are spending money, but the shift has been more to what is called on-demand retail. In other words, consumers want to be able to purchase what they want, when they want on their device of choice with a personalized experience from wherever they are.

Retailers have been overbuilding stores for years, and this overabundance of dying retail square footage adds to the cost pressures that many face. And most retailers are also planning a heavy digital footprint in order to compete with ecommerce titan Amazon.

Although last week's news that U.S. retail sales were flat compared with an expected 0.4% uptick is disappointing, online sales still grew 1.3%, while receipts at physical locations fell 0.5%.

The shuttering of the Macy's stores is actually a good thing for consumers and shareholders. It will allow the company to recast the role of the company in a unified commerce world.

For many consumers, this helps facilitate the purchase-online-and-deliver-to-home scenario that takes brick-and-mortar stores out of the shopping experience altogether. Offering consumers same-day or even one-hour delivery options for online purchases and compatibility with an array of digital wallet platforms, among other strategies, can help mitigate the risk of Macy's and similar retailers from becoming a dying breed.

This is exactly the challenge that Macy's and other traditional retailers have faced for a few years. They are struggling to adapt in the race to compete with Amazon and other ecommerce companies. 

Shifting focus away from stores that under-perform or don't deliver on a great experience allows Macy's to put its capital and energy toward building a unified commerce ecosystem that isn't as heavily reliant on traditional in-store sales.

Walmart's ecommerce business has been lagging far behind Amazon, and Sports Authority announced the shuttering of its stores ahead of schedule, as that company moves at a clip toward total liquidation. Last week, however, Walmart said that it has agreed to buy Jet.com for $3 billion in cash and another $300 million in stock to sweeten the deal.

In a statement, Walmart's Chief Executive and President Doug McMillon, said that company's strategy is to lower prices, expand offerings and build a better customer experience, noting that "we believe the acquisition of Jet accelerates our progress across these priorities."

Don't be surprised in the coming years if other big-box retailers also become hyper-focused on their ecommerce businesses.

After all, the pressure is on to keep up with what customers want. And the fact is that each year fewer and fewer of us want to get in the car and drive to a mall.

Retailers that don't evolve will face some trying times.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.