American retail is in a full blown crisis. Last year, Toys 'R' Us filed for bankruptcy. A few days ago, Sears followed suit. Other big names like Walgreens, Gap, J.Crew, and Macy's are struggling to keep their heads above water.

Yet one well-known name is on remarkably solid footing: Best Buy.

Claiming about 15 percent of the U.S. consumer electronics market, the retailer's profit margins and revenue are stable, with the latter beating expectations in six of the last seven quarters. Its overall number of stores has held steady for a decade, at around 1,000 nationally. Its share price has jumped around 270 percent in the last five years, a run of success called "remarkable" by none other than Jeff Bezos, the CEO of Best Buy's putative vanquisher Amazon.

This wasn't inevitable. Best Buy faces as much competition from e-commerce giants like Amazon and low-cost superstores like Walmart as anyone. Indeed, the chain seemed headed for oblivion just six years ago.

How did Best Buy avoid the retail apocalypse?

Let's start with the fateful turn it made in 2012. At the end of that year, the company was sinking under massive losses: Its stock price touched $12 a share, its lowest point in over a decade. To right the ship, Richard Schulze, Best Buy's founder and former chairman (before an internal scandal pushed him out of that position), tried to partner with private equity firms to buy the company, only to see the deal fall through. As it turned out, this was a blessing in disguise.

Unlike Toys 'R' Us or Sears, which were both sunk by the debt foisted on them by massive leveraged buyouts, Best Buy was able to stay nimble. In fact, it's only gotten nimbler. Since 2012, Best Buy has actually cut its debt load in half and increased its cash on hand almost threefold. And while interest payments were gobbling up 4 percent of Toys 'R' Us' revenues before it went under, they only accounted for 0.2 percent of Best Buy's total sales. As rivals were being felled by balance sheets overloaded with debt, Best Buy was cleaning up its own.

The year 2012 is also when Hubert Joly was brought in as CEO. As an outsider with a McKinsey pedigree and stints at hospitality and media companies, Joly recognized the interplay between physical stores and online sales in building customer loyalty. He turned the stores into showrooms for the company's wares, while completely overhauling Best Buy's shipping infrastructure. The company's software was updated, its warehouse systems and procedures were revamped, and its same-day delivery was massively expanded. From 2012 to 2018, the company's online sales doubled to 16 percent of all revenue — a much higher portion than other major retailers.

Early in his tenure, Joly took a particularly big risk by promising to match the prices of Amazon and a number of other competitors. But he also did something clever: Joly brought brands like Amazon, Apple, and Samsung into the fold, allowing them to open boutique mini-showrooms in the stores. They basically pay Best Buy rent for the opportunity, saving them the money of opening their own stores and allowing Best Buy to piggy-back on their brand success.

Meanwhile, the Geek Squad became a kind of in-house, in-person tech support for Best Buy customers. And now Joly's expanding the idea to "in-home advisors" who will actually come to people where they live to consult on TVs, entertainments systems, audio, and all the rest. It's gimmicky, but it reminds customers of the value of brick-and-mortar stores.

As for Best Buy's workers themselves, their pay remains middle-of-the-pack for retail. But Joly has invested in training, both to improve customer service and employee morale. Worker turnover fell from 50 percent to 30 percent over the last few years. Joly reinstated a generous employee discount program that had been cut by a predecessor. And to his credit, he has avoided layoffs as much as possible. "Taking people out is the last resort," Joly explained in 2015. "Because you need to capture the hearts and minds of the employees."

None of this is to suggest Best Buy's CEO is some sort of pro-worker hero. But Joly seems like a conscientious businessman who wants to keep his company on a sound financial footing. Meanwhile, Best Buy's story is really just about the mundane, common-sense ways a business can adapt to changing circumstances, so long as it isn't being bled dry by Wall Street.

It might be depressing, but in this day and age, that counts as a success.