The stock market was unstoppable in 2013.

Market matters

Some lessons from the year of the bull market:

Small companies, big returns: The Russell 2000, which tracks small stocks, rose 37%, more than the Dow and the S&P 500. Smaller firms are more U.S.-focused, so they benefit more when the U.S. outpaces other regions. That's what happened in 2013.

Bond party's over: With 10-year Treasury notes paying interest below 3% for most of 2013, bonds weren't sexy. From 1981 to 2012, government and company bonds rose 35%, according to the Barclays Capital U.S. Aggregate Bond Index. This year, bonds in the index handed investors a loss of 2%, the first since 1999. As the economy improves, many think rates will keep rising and bonds will fall further.

Buy or sit out?: The S&P 500 has gone 27 months without a correction, or a drop of 10% or more. Investors who sat out have a quandary: Buy now that stocks have become more expensive, or wait for a dip and get left further behind?

Lack of love: Signs of euphoria were mostly absent from the market, despite the big gains. In fact, the market seemed out of step with a fragile economy. The pace of acquisitions lagged, and profits rose, but largely due to cost-cutting. Hiring picked up but was sluggish. The last time investors put more money into U.S. stock funds than they took out was 2005.

IPOs are back: The number of initial public offerings hit its highest level since before the recession in 2007, according to Dealogic. It's easier to sell shares in a climbing and steady market because investors are more confident they can make money. The average IPO stock rose 35%, said Renaissance Capital.

Dividends count: Investors focused on dividends as bond yields started 2013 near record lows. The S&P 500 dividend yield, which measures the payout on stocks vs. their price, started the year at 2.17%, higher than the 1.76% yield on 10-year Treasurys. Companies are also taking note: As of Dec. 20, 417 firms in the S&P 500 paid dividends, the highest number since 1998.

Change is constant: The 30-member Dow got its biggest shake-up in almost a decade. Out went Alcoa, Bank of America and Hewlett-Packard. In came Nike, Goldman Sachs and Visa. No longer dominated by heavy industry, the Dow now contains financial firms and retailers, reflecting the changing U.S. economy.

Europe's on the mend: In 2012, concerns about Spain and Italy weighed on U.S. stocks. In 2013, despite some flashbacks, such as the collapse of the Cypriot banking system in March, investors didn't panic.

Glitch hitch: A technical glitch halted trading on the Nasdaq for 3 hours in August, embarrassing the exchange that lists the biggest names in technology.

Source: AP

A U.S. government shutdown, fear of a default, the threat of military action in Syria, big budget cuts, and a European country looking for a bailout - any number of events might have derailed the stock market. They didn't. And if skittish investors jumped out of stocks, they lost out.

"2013 would have been good year to wear noise-canceling headphones," says Dean Junkans, chief investment officer for Wells Fargo Private Bank. "There were a lot of things that happened, and the market kept moving higher."

On Tuesday, stocks climbed again. The S&P 500 rose 7.29 to close at 1,848.36, its latest record close and for it best year since 1997. It ended 2013 up about 29.6 percent.

The Dow Jones industrial average also had a stellar performance, climbing about 26.5 percent, its best gain since 1995. On Tuesday the blue-chip index closed up 72.36 to 16,576.66. The Nasdaq rose 22.39 to 4,176.59, 38 percent jump from a year ago.

Instead of worrying about the wider world, investors last year focused on the Federal Reserve and the outlook for its stimulus program.

The Fed bought $85 billion in government bonds each month in 2013. The purchases were designed to hold down long-term borrowing rates and encourage spending and investment. They also prodded investors to move from low-yielding bonds to stocks.

Investors reacted to every twist and turn of the program's fate. They sold stocks in the spring and summer over fears the central bank would slow its bond-buying prematurely. They worried that every bit of good economic news signaled the end of support. But in December, as hiring grew consistently stronger, investors were confident enough in the economy that they reacted positively when Fed officials finally decided to dial back purchases. The Fed also reassured the market by signaling it would keep short-term rates near zero. The stock market, which hovered below all-time highs, returned to record territory.

Of course, it wasn't all about the Fed. Companies also played a part.

Despite a middling economy, U.S. corporate earnings rose for a fourth straight year. Total earnings for S&P 500 companies in 2013 are forecast to increase 5.37 percent, according to data from S&P Capital IQ.

"It's tough to argue that companies are in anything other than good health," says Paul Atkinson, head of North American equities at Aberdeen Asset Management.

Investors, emboldened by the Fed's support and low inflation, were willing to pay more for those earnings.