Stock exchanges operate as auction markets where buyers and sellers come together to trade shares. Prices of equities are determined by supply and demand. When a company decides to go public, it conducts an Initial Public Offering (IPO), allowing the public to purchase shares. Once listed, the company's shares can be traded on the exchange, with prices fluctuating based on market conditions.