Since 1926, stocks have returned an annual average of 10.5 percent, long-term government bonds returned 5.1 percent, and "cash," measured by Treasury bills and other short-term investments, has returned just 3.1 percent. In other words, if you're investing for the long-term, stocks are the place to be. But in the short term, the stock market can be downright dangerous, with much more severe drops than the bond market has.
That's where this rule comes in - the younger you are, the more time you have to recover from stock-market crashes. As you get older, you should gradually move money out of stocks and into bonds.