The stock market is closely related to the health of corporations so the performance of the stock market often reflects what is going on in the economy.
When downturns come in to the U.S. economy it is also felt in the stock market. If you graphed out all the recessions from 1945-2000 you will see that $1 invested at the end of 1945 becomes $1,000 by the end of 2000. However, the most important aspect of this is to examine the economic recessionary periods and correlate it to the stock market performance. Immediately before, after or during a recession the stock market is almost always affected negatively.