Shares are units of ownership in a company. When a company goes public and lists on a stock exchange, they issue shares that investors can buy and sell. The stock market is where these transactions take place, allowing investors to buy shares from other investors or directly from the company through initial public offerings (IPOs).