The end is nigh for at least a few retailers.

It’s been a bleak year for the brick-and-mortar retail industry. Stock prices and earnings have fallen. Store closures are being announced. The Amazon threat continues to grow, both via e-commerce efforts and now, with the acquisition of Whole Foods, as an established physical chain. But it’s a mistake the blame Amazon and leave it at that. To look dispassionately at what’s plaguing the retail industry and how it can fix its problems, consider a surprising historical parallel: the airline industry.

In the 2000s, the airline industry was in terrible shape. US Airways and United Airlines filed for bankruptcy in 2002 in the aftermath of September 11th. Delta Air Lines and Northwest Airlines filed for bankruptcy in 2005, plagued by rising oil prices and competition from low-cost airlines. American Airlines filed in 2011. Anyone who suggested during that period that the industry would one day thrive would have been laughed at.

And yet, the story of airlines this decade is one of record profits. What happened? That wave of bankruptcies created space for the industry to restructure itself. Firms merged. Debts were written off. Labor contracts were renegotiated. Unnecessary hubs in places like Memphis and Northern Kentucky were abandoned. And the management teams that emerged from bankruptcy became laser-focused on shareholder returns rather than market share and capacity growth.

This is the future the retail industry is stumbling toward. Amazon is a big and growing presence in retail, but there’s a limit to its growth. The “last mile” problem in delivering retail products, particularly outside of dense and wealthy communities, will remain challenging for the foreseeable future. Amazon’s purchase of Whole Foods can be seen as an admission…