How the Stock Markets Work