What's interesting about these three quotes?

"The market remained almost entirely professional [today], as the investing public continued to leave stocks severely alone."

"At least 7 million shareholders have defected from the stock market … leaving equities more than ever the province of giant institutional investors."

"Across the country, investors are fleeing the stock market for the safety of cash."

The first is from 1932. The second is from 1979. And the last is from 2011.

For as long as there has been a stock market, there have been raging bull markets and crushing bear markets. After the latter, investors silently come together and agree that stocks are rigged against them -- an Ivy League gambling machine for suckers. They become frustrated and move on.

Yet the verdict of history is clear. Of the major assets most investors can own, stocks have performed the best on average over the long term -- by a long shot. Deutsche Bank recently published its annual Long-Term Asset Return Study, which tells the story:

Asset

Average Annual Real Return, 1838-2012

Stocks 6.49%
Treasuries 2.77%
Corporate Bonds 2.72%*
Gold 0.35%

Source: Deutsche Bank. *1913-2012; longest available period.

So, if history is so clear, why do investors write off stocks time and time again? I think it's a misunderstanding of three basic things.

1. If you want stocks to work in your favor, you have to hold them a really, really long time
The average stock these days is held for about seven months. That's pathetic, and it goes a long way to explain why so many investors -- professional or otherwise -- grow frustrated with poor returns.

There's just no way you can expect to earn a decent market return if your time horizon is measured in months. In the short run, stocks are bucked around by fear, greed, rumor, and drivel. Only when stocks are held for years -- many years -- can you be reasonably assured that accumulated business value will be reflected in market returns. The longer you hold them, the more likely it is that solid average annual returns will materialize, and vice versa.

There's a neat way to show this. Going all the way back to 1871, here's how much the maximum and minimum real (inflation-adjusted) annual market returns have been after holding the S&P 500 (INDEX: ^GSPC) for different amounts of time:

Source: Yale, author's calculations.

Hold stocks for a year, and you're at the mercy of the market's madness -- maybe a huge up year, or maybe a devastating loss. Five years, and you're doing better. Ten years, and there's a good chance you'll be sitting on positive annual returns. Hold them for 20, 30, or 50 years, and there has never once been a period in history when stocks have produced an average annual loss.

The same can't be said for bonds. Wharton professor Jeremy Siegel once compiled data similar to the chart above using Treasury bonds. Going back to 1802, Treasury bonds have suffered bouts of negative real annual returns over 20- and 30-year periods. As Siegel noted at a conference I attended last year:

Even when looking at periods that ended in the bottom of the Great Depression, stocks had a positive real return if held for 20 years. You have never lost money in stocks over any 20-year period, but you have wiped out half your portfolio in bonds. So which is the riskier asset? And nothing that's happened over the past ten years negates this data.

To me, this is a razor-sharp argument on why you should prefer stocks if you have a long time frame. But it's also really telling. Do most investors know you may need to hold stocks for 20 years before seeing positive average annual returns? I doubt it. And that's why so many get frustrated and leave, robbing themselves of long-term opportunity.

2. Starting valuation determines future returns  
The Dow Jones (INDEX: ^DJI) traded at a lower level in August 2011 than it did in August 2000 -- before dividends, that's 11 years of negative returns!

This shouldn't be surprising given the chart above. But it should make you ask: Why do long stretches of negative returns happen?

Almost invariably, the answer is simple: Starting valuations were too high.

Over the long haul, stocks return an average of about 7% a year, and trade at an average of about 18 times earnings. But averages are… averages. What happens in between is a wild mix of annual returns well above or below the 7% average.

When stocks go through a period of above-average returns and valuations jump to above-average levels, they will be followed by a period of below-average returns to balance it out. This is simple reversion to the mean. And you can count on it like clockwork.

So, back to the year 2000 example. Yes, stocks declined from 2000 to 2011. But what happened before that? We had several years of preposterously good returns that created nosebleed valuations -- the dot-com bubble! What followed (the last decade) was reversion to the mean.

Taken all together -- the bubble boom and its aftermath reversion to the mean --  the Dow produced returns almost exactly equal to historic averages from 1995-2011:

Source: S&P Capital IQ, author's calculations.

Just what you should expect.

Buy stocks when they're cheap, and future returns will likely be high. Buy when they're reasonably valued, and you'll do just fine. Buy when valuations are high, and you'll suffer for years. You get what you don't pay for. This is the single most important (and ignored) lesson of investing.

3. Volatility. It's real!
This one ties the first two together.

Investors likely become frustrated with stocks because they once heard that stocks return 7% to 9% a year, and they've been lulled into thinking it's true.

But it's really not. While the long-term average return has been about 7% a year, stocks rarely return that much in any given year. Instead, they spend the majority of years returning either far more, or far less, than the 7% average:

Source: Yale, author's calculations.

In the 141 years since 1871, the S&P 500 has spent 75% of the time outside of the range most investors would likely consider "normal." Stocks have spent far more years up or down more than 20% than they have in the neat 1%-10% range they're sometimes marketed as producing.

What that shows is so important: If you want to earn historically average returns over the long haul, you have to put up with a maddening amount of volatility. You have to take the ups with the downs. It's part of the game.

It's perfectly normal for stocks to fall 20% in a year. It doesn't mean the economy is broken, the game is rigged, or that you should give up. It's just what they do. They've always done it, and they'll do it again in the future.

As investor Frank Holmes once put it, "Don't let [volatility] scare you. It's normal. Use the volatility to your advantage. Don't become bitter. Become better."

Fool contributor Morgan Housel doesn't own shares in any of the companies mentioned in this article. Follow him on Twitter @TMFHousel. The Motley Fool has a disclosure policy. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. Try any of our Foolish newsletter services free for 30 days.