"People do not get what they want or what they expect from the markets; they get what they deserve ... Mr. Market doesn't give a hoot. He's got a 'Capitalism at Work' t-shirt on and a sledgehammer in his hand."

-- Bill Bonner

Stocks create and destroy value two different ways. One is determined by how much profit a company earns. The other is driven by changes in how the market values those profits. Sometimes, the market is excited and values profits at a huge premium. Other times, it gets depressed, and changes its mind. That's really all there is to the stock market.

That simple explanation also tells us a lot about Hewlett-Packard's (Nasdaq: HPQ) plunge in recent years. HP shares fell 13% yesterday, and are down 33% year to date. They're down 70% in the last five years, 80% in the last 12 years.

What happened? This chart tells the story.

Hp

Source: S&P Capital IQ.

HP's earnings have actually done pretty well in the last decade -- they're the red line in this chart. Earnings per share doubled from 2000 through the second quarter of this year. Yes, they've stumbled a bit lately. But that doesn't explain an 80% nosedive.

What matters far more is the blue line, showing HP's price-to-earnings ratio. That's how much the market values HP's earnings. And it's gone straight down over the last 12 years, from more than 50 in 2000, to 20 in 2008, to about six today. That's one of the most severe compressions in valuation multiples you might ever see.

The vast majority of HP's problems are not about poor earnings per se. They're about the market's plunging confidence in those earnings, driven by a fear that they'll keep falling in the future.

Maybe that's rational, maybe it's not. Either way, HP shareholders, meet Mr. Market's sledgehammer.