The stock market lets investors buy and sell small pieces of ownership in publicly traded companies. In doing so, it distributes control of some of the world’s largest businesses among hundreds of millions of individual investors. It also sets the values of those companies. For example, a stock market that goes up might encourage corporate investment (and job creation and expansion), while a declining market could lead to layoffs. This is one reason why the stock market is considered a barometer of the economy and an important economic indicator.

Investing in shares is ideal for long-term purposes, such as retirement, and it can offer higher returns than the rate of inflation. However, the value of a share can fall and many people lose money in stocks due to volatile markets.

In general, the stock market works as a kind of matchmaker that pairs sellers with buyers each day that it is open. These sellers may be companies selling their own shares, either through an initial public offering or by being listed directly on the exchange, or they could be other individuals wishing to resell shares they previously bought. Intermediaries such as brokers and online trading platforms facilitate these transactions by matching “bid” and “ask” prices: the highest price that a buyer is willing to pay for a share and the lowest that a seller is willing to accept.

Some of the most prominent participants in the stock market include individual retail investors, institutional investors such as pension funds, insurance companies, mutual funds and exchange-traded funds, investment banks, and financial institutions. There are also robo-advisors that automatically manage investments for individuals.