Your stockbroker acts as an agent on your behalf and does not actually buy or sell the stocks you select. The broker's firm will be a member of various stock exchanges or have a working relationship with a member firm. When you give your order to the stockbroker it is sent to the trading department of the broker's firm and from there to the firm's represesntative, known as a floor broker, at a specific stock exchange.
Traders do the actual buying and selling of stocks and deal only with traders at other brokerage firms. Brokers work only with investors. Traders often use the NASDAQ system to find buyers and sellers of stocks. The broker types in the name of the stocks the investor wants to buy and finds a list of brokerage firms willing to sell the stocks and a specific price. The trader then contacts one of those brokerage firms and places an order for the stocks.
The trader informs the broker that the stocks have been purchased. The investor is informed of the purchase and the commission fee is charged to the investor's account.