The stock market is a place where people trade shares of publicly traded companies. Buying and selling happens through brokers, but a growing amount of trading is now done electronically. A key function of the stock market is to match stock sellers with buyers, who can be individuals looking for a way to diversify their portfolios or simply interested in making money. Exchanges also make it possible to compare the performance of companies with one another (via indexes).
Stock prices rise and fall based on supply and demand. If lots of investors want to buy a particular stock, that will push the price up and entice existing stock holders to sell for a profit. Conversely, if a stock is losing favor with investors or the company itself is having trouble, the price will sink. Various factors can influence demand, from the latest earnings reports to economic conditions in this country and abroad.
The stock market is also essential for providing capital to public companies that need it to grow and expand, or even to reward employees. By allowing companies to issue and sell shares, the stock market provides them with access to funds they might otherwise have difficulty raising from lenders. It also allows investors to profit by owning a piece of a company, through dividends and capital gains as the value of the shares increases. This relationship can also work the other way, as a healthy stock market can help support the economy by giving people money to spend on other things.