A good chart can completely change the way you think about investing and retirement planning. There's no single graphic that's going to tell you everything you need to know, but there are some that contain more valuable lessons than others. One particular chart is extremely common, but it illustrates more important concepts than most people realize.

The S&P 500 index

At first glance, a chart of the S&P 500's performance over the past few decades probably isn't very illuminating for most investors. We take for granted that the stock market has steadily risen over the decades, and most people expect their 401(k) to grow over time if it's invested. That's understandable, but a closer inspection of the chart reveals key investing concepts that serve as the foundation for retirement planning.

^SPX Chart

Data by YCharts.

Long-term gains and short-term uncertainty

The chart clearly shows a trend up and to the right, which is exactly what investors usually want to see. However, if you zoom in on any portion of the chart, you will see deviations from that overarching trend. Those deviations can be large or small, short or long, but they are clear and numerous once you look for them. Nobody should be surprised that there are economic cycles and bear markets from time to time. However, it's important to acknowledge the potential contradiction in long-term and short-term stock market performance and to think about their implications for retirement planning.

Three people sitting at a table discussing charts displayed on a tablet computer.

Image source: Getty Images.

Simply put, the stock market provides predictable positive returns over a long enough time frame, but it's consistently unpredictable over any short-term period. Any good retirement plan must account for both of these facts. Investment portfolio allocation needs to reflect the risks and opportunities presented by these conditions in the context of each investor's personal circumstances.

Positioning for long-term growth

The stock market's overall trend means retirement accounts can be confidently invested for growth, provided that your time horizon is long enough. Returns were positive for almost every rolling 15-year period in the S&P 500's history. Returns have never been negative for any 20-year period. That's not to say it's impossible to generate negative returns across two decades, but it's important to recognize the key stock market drivers that lead to these long-term trends.

Stock prices reflect supply and demand, like any normal good or service. Supply and demand for stocks vary over time based on a number of factors, including capital market conditions and fundamental business performance. Capital market conditions are driven by investor greed, fear, optimism, and risk tolerance, and they often reflect macroeconomic factors, such as interest rates. They often coincide with economic cycles, and they can lead to massive swings in stock prices over short periods of time, resulting in the most extreme bear and bull markets.

Over the long term, however, a stock's value reflects the underlying company's fundamentals -- its financial performance measured by revenue, profits, cash flow, and dividends. Shareholders are ultimately entitled to the surplus profits generated by the business, so stock valuations reflect a company's expected future cash flows. If you apply that observation to the market as a whole, then the S&P 500 should roughly reflect the expected ongoing growth of the economy as a whole. Business fundamentals expand as the global economy marches onward, so stock valuations should march similarly higher.

That's exactly what the long-term chart shows. The market as a whole averages 7% to 10% annual returns, depending on the time frame under consideration. We know that downturns and bear markets happen, but you generally shouldn't be too concerned about those if you're more than 15 years away from retiring. Even if there's a market crash tomorrow, you should have plenty of time to recover. On the flip side, you shouldn't expect to generate returns that are much better than the long-term average. It would be exceptional to consistently beat major indexes by even one or two percentage points. Using index funds is a fine approach for your 401(k). That can be supplemented with a more active strategy, especially if you have an IRA.

Managing short-term volatility

That brings us to the unpredictable and volatile nature of the market in the short term. The best and worst individual years of the market have been far more extreme than the best and worst decades, in terms of annual rate of return. A good investment portfolio should account for this fact, especially as you approach retirement and your time horizon shortens.

When you're within 15 or so years of retiring, it's time to start shifting your allocation away from growth stocks in favor of bonds and lower-volatility equities, such as dividend stocks. Unexpected market downturns can strike fairly quickly, so investors should reduce the risk of a bear market wiping out a significant portion of their savings just before they need to begin making retirement withdrawals. If you need to convert investments into cash in the near future, then you should be confident in the value of those assets when they're sold. Don't expose yourself to excessive volatility if you might not have enough time to ride out the market recovery.

At the same time, not all volatility is negative, even if we usually think about volatility as temporary downside risk. Bull markets happen as well, so it's not wise to sell all of the stocks in your retirement account in your 50s or 60s.

Many 401(k) plans offer target date funds, which relieve investors of the burden of rebalancing and reallocating over time. Otherwise, it's important to review your retirement allocation every year to confirm that it's aligned with your goals and risk tolerance.