Much of the retail apocalypse is in fact a long-overdue correction. The United States devotes four times more of its real-estate square footage to retail, per capita, than Japan and France; six times more than England; nine times more than Italy; and 11 times more than Germany.

The way Americans shop is also undergoing a fundamental reset. As more and more people shop online, the stores that are drawing in customers are those that emphasize experiences. Customers want to sit on that new sofa, feel the weight of a stainless-steel skillet in their hands, and try out new gadgets.

In fact, the line between e-commerce and physical retail is not as traceable as most people think. The most successful virtual stores are currently increasing their physical presences. Amazon is opening up bookstores, and with its acquisition of Whole Foods, it has gained a footprint in hundreds of affluent cities and suburbs. As the physical embodiment of Apple’s brand proposition, Apple stores showcase cutting-edge designs, provide service and advice, build community, and are a big part of what differentiates the company from its competition.

While there can be no doubt that the lost jobs and diminished tax bases that accompany the retail retrenchment hurt, the shift has an upside as well.

WeWork’s takeover of Lord & Taylor could be a good portent for urban economies. Work, not shopping, is the key to urban productivity and growth. When asked why rents are so high in cities like New York and Chicago, the Nobel Prize–winning economist Robert Lucas famously answered that it had nothing to do with the availability of high-end shopping; higher urban rents, he said, are a function of higher urban productivity.

As talented people and high-paying jobs move back to cities, there is demand for more office space. Big companies like Google or Amazon can afford to build their own new facilities. But smaller companies and gig-economy workers need flexible coworking spaces that companies such as WeWork provide, and they need affordable living spaces as well. Both of these can be built in the shell of former retail spaces. In downtown Providence, Rhode Island, for instance, the Greek Revival Westminster Arcade, built in 1828 as the nation’s first indoor shopping mall, has been redeveloped to include dozens of micro-apartments.

The back-to-the-city movement is driven by the preferences of talented people for urban amenities, including places like mom-and-pop shops and small hardware stores that are increasingly threatened by skyrocketing rents that only big retail chains and luxury brands can afford to pay. However, as those companies scale back their retail, real-estate developers have an opportunity to refill their storefronts with independent, artisanal, and local shops. While property owners will take a hit on commercial rents, the overall value and desirability of their buildings will likely rise.