The decline of consumer electronics retailer RadioShack (RSHCQ) over the past five years has led to enormous losses for those investors unfortunate enough to own the stock. In early 2010, RadioShack was valued at $3 billion, and it was still turning a healthy profit. Fast-forward four years, and the retailer's market capitalization has fallen by nearly 97%, to just $100 million, and 10 straight quarters of losses have put the company in dangerous financial territory.

I've argued before that RadioShack is unlikely to survive this crisis, but a few important lessons can be learned from the looming demise of a once-great retailer.

Gaining a competitive advantage in retail is hard
Retail is a difficult business, and consumer electronics retailing can be downright brutal. For the most part, all consumer electronics retailers sell the same products, and gaining an edge against the competition while still turning a profit is a Herculean task. The list of failed consumer electronics retailers is a long one. Circuit City, CompUSA, and Tweeter are among those to expire in recent years, and RadioShack is at risk of joining that list.

RadioShack's key advantage is that its stores are conveniently located. More than 90% of the U.S. population lives or works within minutes of a RadioShack location, according to CNN Money, and this fact allowed the company to remain successful through 2010. But the Internet changed things. With consumers able to get products shipped to their door within a few days of ordering, while paying less than the high prices RadioShack typically charges, the company's advantage began to slip away. RadioShack managed a gross margin in excess of 45% through 2010 on what were essentially commodity products. This number fell to just 34% in 2013.

Having a large number of physical locations is no longer an advantage in and of itself. Best Buy (BBY 1.09%) also operates plenty of stores, but it now uses those stores to ship online orders directly to customers, speeding up shipping times, increasing online availability, and allowing its e-commerce business to grow rapidly. RadioShack has a negligible e-commerce business, and its convenient store locations have become a massive liability instead of a competitive advantage.

Things can change quickly
At the end of 2012, RadioShack's situation did not appear nearly as dire as it does today. Sure, things weren't great, but the company had a strong balance sheet, and management seemed upbeat about stabilizing profitability. At the time, RadioShack had a little more than $500 million in cash; along with $391 million available under a credit agreement, the company appeared to have plenty of liquidity available to weather the storm and carry off a turnaround. Even with a loss of $139 million in 2012, RadioShack seemed to have enough money to survive for quite some time.

But the situation deteriorated extremely rapidly. In 2013, RadioShack lost $400 million after revenue plunged, and the company did not announce any major store closings until early 2014. Reluctant creditors stymied these closings, and the company has so far been unable to close very many of its thousands of stores. After the most recent quarter, RadioShack had just $30.5 million in cash and total liquidity of $182.5 million. A new financing deal announced in October bought the company some time, but the situation remains grim.

RadioShack's decline was not slow and gradual, but fast and violent. Although revenue and profit had stagnated from 2004-2010, RadioShack remained profitable, maintaining gross margins in excess of 45% and operating margins in the mid-to-high single-digits. It was only after 2010 that things started to go seriously wrong, and it was only during the past two years that the business completely unraveled. But there were signs of trouble well before these huge losses began, with the company's competitive advantage beginning to evaporate, and those who ignored these warning signs have been treated to quite the collapse.

Revenue means nothing without profits
An argument I've seen countless times for why RadioShack is undervalued relies on the fact that the company's stock trades at a tiny multiple of sales. RadioShack had $3.4 billion in revenue in 2013, about 34 times the current market capitalization. Best Buy's market capitalization is a little less than a third of sales, for comparison, and at a similar valuation RadioShack would be worth far more than it is today.

But RadioShack's revenue is meaningless if it doesn't generate any profit. The price-to-sales ratio is not all that useful because profit margins can vary wildly from industry to industry, and even between companies in the same industry. Best Buy earned a profit last year; RadioShack did not. RadioShack therefore deserves to trade at a far lower P/S than Best Buy, and it does.

Ultimately, the stock price is based on profits, not sales. When you hear people using the P/S ratio as a way to value a company, you should run. Of course, fast-growing companies that don't turn a profit aren't worthless. There's the expectation that they will ultimately become profitable, and the stock is priced on that expectation. But RadioShack is not a growing company, and there's no sign yet that its turnaround effort is working. Losses are still growing, and valuing the company based on sales is a terrible idea.