What is a stock exchange and how does it work?