Remember, a company’s first set of public investors buy the shares directly from the company! Each subsequent transaction in the stock is between two existing investors and not the company. Therefore, a computerized system is used by the exchange to match a buyer with a seller in no time!
A liquid market is characterized by a high volume of buy and sell orders and a low Bid-Ask Spread. Bid-Ask Spread is the difference between the highest price quoted by a buyer and the lowest price quoted by a seller.
A trade is finally executed when two orders are matched. For this to happen, either a buyer must accept a higher price or a seller must accept the buyer’s lower price. In case of a mismatch in the demand and supply, such orders will remain unfilled until equilibrium is restored.
So, exchanges match orders! What else?