"In risk assets, you make 80 percent of your money 20 percent of the time."

The next time you think it's a good idea to get in and out of the market based on some vague notion that you can predict ups and downs, remember that line, which came from investing great Jeff Gundlach during a presentation last week.

Smart investing is not complicated, but it can be terribly difficult. The single biggest reason why most investors fail is simple and widespread: Money flows in and out of assets at exactly the wrong time -- in just when things are expensive, and out just as they're cheap. One 2007 study found that mutual fund investors earned an actual annual return of 1.6% below their funds' stated performance from 1991 to 2004 due to buying high and selling low. Compounded over the course of a lifetime, that can literally be the difference between retirement and no retirement.

It happens over and over again. And it will keep happening in the future. Unless you understand Gundlach's advice, you'll probably fall for it as well.

Stocks outperform most assets over the long run. Most agree on that, and history is pretty clear on setting the record. Ideally -- and rationally -- anyone with more than 10 years to invest would buy stocks at good prices and forget about it. You know you're in the right asset for the long haul. So why fret and bother second-guessing, tweaking your portfolio between other assets?

Part of the reason investors second-guess stocks is due to how returns have been marketed. Started by academics and run with by Wall Street marketing geniuses, the concept investors have been told time and time again is that stocks return something like 7% to 9% a year over the long run -- better than any other asset class. And that's true. They have.

But that can be misinterpreted to imply that stocks return 7% to 9% every year. And folks, they emphatically do not. While the long-term average annual return works out to 7% to 9% a year, what happens in between is wild and chaotic. In fact, stocks spend more years down more than 20% or up more than 20% than they do within the 7% to 9% range. Here's how it breaks down since 1928:

Sources: Yahoo! Finance, author's calculations.

Even this chart hides how skewed returns are over time. I've shown before that there have been about 21,000 trading sessions between 1928 and today. During that time, the Dow went from 240 to 13,000, or an average annual growth rate of 5% (this doesn't include dividends). If you missed just 20 of the best days during that period, annual returns fall to 2.6%. In other words, half of the compounded gains took place during 0.09% of days. That's a more detailed version of Gundlach's wisdom.

Now, every time that stat is used, someone says, "Sure, but what if you missed the worst 20 days?" Indeed, if you missed the 20 worst trading days since 1928, average annual returns jump to over 7% (before dividends).

But what's interesting about those 20 worst days? Most happened at nearly the same time as the best 20 days -- 1933, 1982, 2002, and 2008. It's implausible to think anyone could have avoided the worst days and hit the best days without simply being lucky. It can literally mean in Monday, out Tuesday, back in Wednesday.

Most of us at The Motley Fool think that the best way to build wealth is to buy good companies at good prices and hold them for a long time. Staying invested, in other words. That could mean having to endure a few years -- sometimes several years -- of really bad performance. That's OK. It happens. It's a perfectly normal part of stocks' long-term superior performance, as counterintuitive as it seems. "Volatility scares enough people out of the market to generate superior returns for those who stay in," Wharton professor Jeremy Siegel said last year.

What we're not into is thinking we can time the market -- get in now, get out now, "I'm expecting a weak second quarter," that sort of stuff. The number of people who can do that consistently and profitably is a rounding error compared with the numbers who try it and end up burned. Most will end up missing out on the 20% of the time when 80% of the profits are made.

There is a place for bonds, cash, gold, and other assets, of course. If you're nearing retirement, or need to access your money at some point over the next decade, being 100% in stocks doesn't make sense. If you don't have an appetite for ups and downs (and many don't), don't even try stocks in the first place. And sometimes valuations make so little sense -- like 1999-2000 -- that selling stocks makes sense for long-term investors based on valuations (but not market timing).

But for most investors most of the time, the surest way to build wealth is to be invested, stay invested, and not get scared out because of temporary fears. Many will ignore or forget that advice. And most of them will end up poorer than if they had not. It's happened in the past, and it will happen in the future.

Check back every Tuesday and Friday for Morgan Housel's columns on finance and economics.