The stock market is where the buying and selling of stocks or shares of publicly held companies are issued and traded, these stocks are bought and sold by a collection of buyers and sellers. This trading often takes place at Stock Exchanges and offers companies with capital in exchange for giving shareholders a slice of ownership in the company. Trading started more than 300 years ago in Europe and also in Japan with Rice. Early London traders met in coffee houses. Much of the trading is no longer face to face but electronically where computers pair up buyers and sellers.
Shareholders that are investing money make money when stocks are sold for more than they were purchased (capital gains). When companies are profitable some also pay dividends. The higher the dividend yield the more the shareholder makes.