What do Usain Bolt and the stock market have in common?

No, it's not that they both leave you in the dust. It's that they keep on setting new records.

Throughout this year, both the S&P 500 (^GSPC -0.46%) and Dow Jones Industrial Average (^DJI -0.98%) have climbed higher and higher, regularly setting new records. The Dow breached 16,000 points to set a new closing high last week. These stock market indexes are making it look just as easy as Bolt did at the Beijing Olympics.

2013 highlights:

Stock index S&P 500 and Dow Jones records

Source: Wall Street Survivor.

The weird thing is, these records have all been set at a time when the headlines are full of economic gloom. So why is the stock market doing so well? And, more importantly, is it sustainable?

Let's take a look at what exactly has been going on.

1. There's easy money out there
The Federal Reserve is keeping interest rates extremely low and going on a government-bond spending spree to the tune of $85 billion a month. This makes it easier for companies to borrow money cheaply, which means more investment, more earnings, and higher stock prices. It also encourages people to invest in stocks, which beats getting 0.1% interest on your bank account. The Fed has long been dropping hints that it could soon begin to draw down its quantitative easing, but now QE seems likely to continue it a little longer, fueling the latest stock market highs.

2.Companies are doing better than individuals

Image source: Wikipedia.

For many people in the U.S., times are still hard. Consumer debt is $3 trillion and climbing, and unemployment is still above 7%. The newspapers are full of gloomy headlines about slow economic growth.

But stock prices are based on corporate earnings, and companies are doing quite nicely, thank you very much. In fact, the earnings of S&P 500 and Dow Jones companies are at a record high, so it's natural that prices are setting records as well. Businesses' margins are at a record high too, which explains some of the disparity between experiences on Wall Street and Main Street. Companies are still cautious about hiring new workers or giving wage increases -- they're squeezing every dollar they can onto the bottom line, which is good for stock prices but not so good for the employees themselves.

3. It's the market, stupid!
The phrase "record high" suggests that something unusual is happening. It makes us think of breathtaking, once-in-a-lifetime events. But in fact, the stock market sets new records all the time. Unless the economy is badly broken, the long-term trend of stocks is always positive -- about 7% a year on average.

Stock prices depend, after all, on corporate earnings, and even if earnings only keep up with inflation, that means an increase of 2% or 3% a year. Companies tend to make money a little more efficiently than that, so a steady increase is natural.

The reason we talk about "record highs" is because the stock market doesn't rise in a simple, linear way. It can fall for years before reaching its previous record high again. The S&P 500 first breached the 1,500-point barrier in the dot-com bubble of early 2000 and then took seven years to climb back to that same point in 2007 before tumbling again and taking six more years to reach it in 2013. So you could think of a "record high" in a different way: the market finally erasing years of losses to get back to where it was before.

So is it sustainable?
Just because the stock market plummeted the last couple of times the S&P 500 rose above 1,500, doesn't mean it will happen again now. Keep in mind the long-term growth profile of the stock market -- the straight line rising steadily at 7% a year, around which all the booms and busts are just so much noise. That line is much higher now than it was 13 years ago.

Let's look at corporate earnings. The P/E ratio is a simple way of evaluating whether a stock or an index is undervalued or overvalued. (If you need a quick refresher, check out this video.) Here's how today's P/E ratio compares with the previous highs of 2007 and 2000:

PE ratio

Source: Wall Street Survivor.

As you can see, earnings today are double what they were at the height of the dot-com bubble. That provides a much more solid foundation for the market, and stocks don't look overvalued. The long-term average P/E ratio of the S&P 500 is around 15, so the current level is not far out of whack.

So long as earnings continue to grow at a decent clip, the stock market rally should have further to run. In fact, you can probably expect to see a few more records broken in the months to come. Poor Usain will be getting jealous at this rate.