The stock market, often considered the heartbeat of the global economy, is a complex and dynamic system where investors buy and sell shares of publicly traded companies.