When central banks raise interest rates in response to positive economic indicators this is typically done to tamp down inflation pressures because they believe it will rise in the future. The other end of this is that increased interest rates will also moderate future economic growth by increasing the cost of borrowing. Interest rate increases by the central banks will be passed on to individuals through financial institutions via loans such as for mortgages, credit lines, and vehicles. Furthermore, the cost of capital for businesses looking to borrow will also increase leading to less business borrowing and suppressed economic activity as both businesses and individuals will have less money to spend.
Because the stock market is a forward-looking indicator it will anticipate that profitability and cash flows of companies will decrease, and this will then lead to a decline in stock prices assuming all other things remain equal. Additionally, from an investor perspective higher interest rates will also make fixed income investments particularly bonds relatively more attractive versus stocks, and hence investors might sell their stocks to purchase bonds.
Conversely when the economy is slowing central banks will usually respond by lowering interest rates. The impact will be the exact opposite of the rate hike and stimulating to the economy, and this will lead to stock prices increasing all other things remaining equal. Individuals will have more disposal income for discretionary spending, businesses will have cheaper money to expand and grow, and investors will be encouraged to purchase stocks rather than bonds as the return on bonds will have declined.
Lastly, it should be noted that financial institutions benefit from rising interest rates as their net interest margins increase. For more information please read the article: How do interest rate changes affect the profitability of the banking sector? on Invesopedia.com. This is an important consideration when determining sector allocation in your investment portfolio.