A stock exchange is a marketplace where orders to buy shares meet orders to sell them. It runs on fixed rules that decide which orders are matched, at what price, and in what sequence. Once you understand those rules, most of what happens to your order makes sense. The core idea is simple, even though the systems behind it are complex.
How an exchange gathers orders in a single place
Every share traded on an exchange has people who want to buy it and people who want to sell it at the same time. Without a shared place to meet, each person would need to find a match by themselves. The exchange collects every order into a single system that participants can see. Gathering the orders in a single place is what makes the price visible to everyone.
An order is an instruction to trade. It sets out what you want to do, how many shares you want, and usually a price. Some orders ask to trade straight away at whatever price is available. Others only trade at a price you set. Both kinds sit in the same shared list until they are matched, changed, or cancelled.
How the order book works
The order book is the live list of orders waiting to be matched. It has a buy side and a sell side. The buy side holds the prices people are willing to pay, with the highest price at the top. The sell side holds the prices people will accept, with the lowest price at the top.
The highest buy price and the lowest sell price sit closest together. When they meet or overlap, a trade can happen. The book also reveals how many shares are waiting at each price. It changes constantly as new orders arrive and old ones are changed or removed.
How orders get matched and who fills first
Matching is the step where a buy order and a sell order agree on a price and are paired. During the trading session, the system checks each new order against the orders already waiting. If the prices meet, the orders pair up and a trade is recorded.
Think of it as a queue at a counter. A person willing to pay the most stands at the front of the buy side. The seller asking the least stands at the front of the sell side. When those prices overlap, a trade happens.
When several orders sit at the same price, the exchange uses time to break the tie. This rule is called price-time priority. Better prices always go first, and among orders at the same price, the one that arrived earlier is filled first.
Here is a plain example. Imagine a few people, all offering shares at the same price. The person who placed the order first is filled first, and the others wait behind. Arriving later at that price does not move you ahead of anyone already in line.
After the trade: settlement and clearing
A trade is agreed almost instantly, but the shares and the payment do not move at the same moment. Settlement is the final transfer of shares to the new owner and money to the other side. It happens after a short window, and the exact timing depends on the market and the product.
Clearing is the work done in between. A clearing house often steps in between the purchaser and the seller after a trade. It checks each trade, confirms both sides, and takes on the risk that either side fails to deliver. Most people never see this step, but it is what lets strangers trade without checking each other's ability to pay.
What a broker does between you and the exchange
You rarely send orders to an exchange yourself. A broker receives your instruction, checks that you have the cash or shares needed, and passes the order into the market. For most individuals, the broker is the link that makes the exchange usable.
Brokers may route orders to different venues, and the way they do this is part of their execution model. Client money is usually kept apart from the broker's own money, but the exact rules vary by country. Check the provider's own documents and your local authority to see what applies to you.
A broker also decides what happens when an order cannot be filled straight away. A clear provider explains these steps in plain language before you trade. Read that explanation carefully, because it shapes what you actually receive.
Where the model stops and common mistakes
The matching model does not guarantee the price you see on screen. Prices can move between the moment you send an order and the moment it is matched. Fast-moving markets and overnight gaps can leave the final price different from what you expected.
Several common mistakes come up again and again:
- Assuming the price on screen is the price you will receive.
- Placing an order without knowing what kind of order it is.
- Believing that speed of trading makes it safer.
- Forgetting that ownership is only fully final after settlement.
Rules and protections differ by country and by provider, so treat this as the general idea rather than a set of instructions for your own decisions.
From exchanges to choosing a broker
Start with how a provider handles orders and client money. The guide to how a broker protects client money explains what to look for. Then look at which markets the provider covers, using the guide to markets a broker offers as a starting point.
If shares are your focus, how to choose a broker for stocks sets out the questions to ask. Read each provider's own documents for the exact rules, and check your local authority for the protections that apply where you live.