Skip to content
Markets and trading education (risk-aware)

How Do Stock Markets Work?

Updated 27 November 2026 · 8 min read · Reviewed against our editorial policy

In brief

A stock market is an organised venue where buyers and sellers trade shares under shared rules, with prices set by the orders they submit. Exchanges match those orders, clearing houses guarantee the trade, and settlement moves the shares and cash, all overseen by regulators. Prices move because supply and demand shift, not because anyone sets them.

  • A stock market matches buyers and sellers through an exchange, and prices emerge from the orders placed rather than being fixed by anyone.
  • Market makers and other participants supply liquidity, which makes it easier to trade quickly but does not remove price risk.
  • Clearing and settlement happen after a trade is matched, so ownership and cash move a short time later under standardised rules.
  • Regulators set and enforce rules on disclosure, fair dealing and broker conduct, but they do not protect you from ordinary investment losses.

This guide explains what happens between the moment you press "buy" and the moment shares appear in your account. It is about the machinery of the market. For what a share actually represents, see our separate guide on what stocks are.

The big picture

A stock market is a set of venues, rules and intermediaries that let people buy and sell ownership stakes in companies. It does two jobs at once:

  • Primary market: companies raise new money by issuing shares to investors, for example in an initial public offering (IPO).
  • Secondary market: investors trade existing shares with each other. This is what most people mean by "the stock market", and it is where day-to-day prices are formed.

In the secondary market, the company is generally not a party to your trade. When you buy 100 shares, you are buying them from another investor, not from the company.

The main players

  • Exchanges: regulated venues that run the order book and publish prices. Examples of the type include national exchanges in the US, UK, India, the Gulf and Southeast Asia. Some countries have several competing venues.
  • Brokers: firms that give you access to the exchange. You send your order to your broker, and the broker routes it onward.
  • Investors and traders: individuals, pension funds, mutual funds, insurers and others who place orders for their own reasons.
  • Market makers: firms that continuously quote prices at which they will buy and sell, earning a small spread for doing so.
  • Clearing houses and depositories: institutions that guarantee trades and record who owns what.
  • Regulators: public bodies, such as the SEC in the US, the FCA in the UK or SEBI in India, that write and enforce rules.

How prices are set: the order book

Most modern exchanges run an electronic order book: a live list of everyone's standing offers.

  • Bids are offers to buy, each with a price and a quantity.
  • Asks (or offers) are offers to sell, each with a price and a quantity.

The highest bid and the lowest ask form the best bid and offer. The gap between them is the bid-ask spread. Our guide on the bid-ask spread covers this in more detail.

A trade happens when a buyer and a seller agree on a price. Nobody announces a "correct" price. The last traded price is simply the most recent point where both sides agreed.

Order matching

Most exchanges match orders using price-time priority:

  1. The best price goes first. A higher bid beats a lower bid, and a lower ask beats a higher ask.
  2. At the same price, the order that arrived earlier goes first.

The two most common order types behave differently:

  • A market order says "buy or sell now at the best available price". It is likely to execute, but the price is not guaranteed.
  • A limit order says "buy or sell only at this price or better". The price is controlled, but the order may not execute at all.

See our guide on market orders versus limit orders for the trade-offs, including stop orders.

A hypothetical trade, step by step

The numbers below are round and invented for illustration. They are not real prices.

Imagine a company, Example Co, with this order book:

Side Price Quantity
Ask 100.20 300
Ask 100.10 200
Bid 100.00 500
Bid 99.90 400

The best bid is 100.00 and the best ask is 100.10, so the spread is 0.10.

Step 1: You decide. You want 100 shares and place a market buy order through your broker.

Step 2: The broker routes it. Your broker checks that you have enough cash, then sends the order to the exchange or to another venue.

Step 3: The exchange matches it. The lowest ask is 100.10 for 200 shares. Your 100 shares fill entirely at 100.10.

Step 4: The trade is reported. The last traded price becomes 100.10. The ask at that level drops from 200 to 100 shares.

Step 5: Cost. 100 shares × 100.10 = 10,010 in currency units, plus any broker commission or taxes. This is illustrative; fees vary by country and broker.

Now suppose instead you wanted 400 shares at market. You would use up the 200 at 100.10 and then take 200 at 100.20. Your average price would be 100.15. Larger orders can move the price against you. This is called market impact or slippage.

If you had placed a limit buy for 100 shares at 100.00, you would join the queue behind other bids at that price. You would only trade if sellers came down to 100.00.

What market makers do

Without a continuous supply of quotes, a buyer might wait a long time for a seller. Market makers fill that gap by posting both a bid and an ask at the same time.

In the example, a market maker might bid 100.00 and offer 100.10. If they buy at 100.00 and sell at 100.10 on the other side, they earn 0.10 per share. Across millions of trades that is their income, and it compensates them for the risk that the price moves while they hold inventory.

Benefits for ordinary investors:

  • Tighter spreads and lower trading costs.
  • Greater liquidity, meaning you can usually trade without moving the price much.

Limits to keep in mind:

  • Liquidity can thin out during stress. Spreads can widen sharply and prices can gap.
  • Smaller or less-traded companies often have wider spreads and fewer participants, so costs are higher.

Clearing and settlement

A matched trade is only a promise. Two further steps turn it into a completed transfer.

Clearing

A clearing house typically steps in between the buyer and the seller. It becomes the buyer to every seller and the seller to every buyer, which reduces the risk that one side fails to deliver. It also calculates what each member owes after netting offsetting trades.

Settlement

Settlement is the actual exchange of shares for cash. Ownership records are held by a central securities depository or through your broker's custody arrangements.

The gap between trade date and settlement date is usually written as T+1, T+2 and so on, meaning trade day plus a number of business days. Settlement cycles differ by country and have changed over time, so check the current rule for your market. Several major markets have moved to shorter cycles in recent years.

Two practical points:

  • You are generally treated as the owner economically from the trade date, but the legal settlement happens later.
  • Sale proceeds may not be available to withdraw until settlement completes, even if you can reinvest sooner depending on your broker.

Why prices move

Prices change when the balance of orders changes. Common drivers include:

  • Company news such as earnings, management changes or product problems.
  • Economic data and interest rate expectations.
  • Shifts in sentiment, which can be rational or not.
  • Large institutional buying or selling.

Prices reflect many people's expectations at once. That does not mean they are always right, only that they are the result of real offers to trade. Short-term moves are hard to predict, and our guide on market volatility explains how to think about them.

Trading hours, auctions and circuit breakers

  • Opening and closing auctions: many exchanges collect orders before the open and close, then set a single price that maximises matched volume.
  • Trading hours: regular sessions are set by each exchange, and extended sessions may exist with lower liquidity.
  • Circuit breakers and price limits: some markets pause trading or limit moves if prices fall or rise too quickly. Rules vary by country, so check your exchange.

The role of regulators

Regulators exist to keep markets fair, orderly and transparent. Typical responsibilities include:

  • Requiring listed companies to publish audited accounts and material news.
  • Licensing and supervising brokers, exchanges and clearing houses.
  • Prohibiting insider trading and market manipulation.
  • Setting rules for how client money and shares must be held.
  • Running investor-protection or compensation schemes in some countries.

Regulation reduces certain risks, such as fraud and misconduct. It does not protect you from a share price falling. Always confirm that a broker is registered with the relevant authority in your country before opening an account, and read our guide on spotting investment scams.

Costs and trade-offs to understand

  • Commissions and fees: some brokers charge per trade, others earn through spreads or other charges.
  • Spread: a cost you pay every time you trade, even if there is no commission.
  • Taxes: many markets charge transaction taxes or stamp duty, and gains may be taxable. Rules change, so check your local official source.
  • Speed versus price: market orders prioritise speed, limit orders prioritise price.
  • Access versus risk: easy access can encourage over-trading.

Common mistakes

  • Using market orders on thinly traded shares. The spread can be wide and the fill price far from the last quote.
  • Assuming the quoted price is the price you will get. Quotes can change in the moments before your order arrives.
  • Ignoring settlement timing. Planning to spend sale proceeds immediately can cause problems.
  • Confusing liquidity with safety. A share that trades easily can still fall sharply.
  • Trading on tips. Unverified claims on social media are a common route to losses and scams.
  • Not checking broker regulation. An unregulated platform may offer no protection if it fails.

A practical checklist before your first trade

  1. Confirm your broker is authorised by the regulator in your country.
  2. Understand the fees, spreads and any taxes that apply.
  3. Learn the difference between market and limit orders.
  4. Check the settlement cycle in your market.
  5. Start with an amount you can afford to see fall in value.
  6. Consider practising with paper trading first.

This article is educational and does not recommend any specific security, broker or product. Investing involves risk, including the loss of the money you put in.

Frequently asked questions

Who sets the price of a share?

No single party sets it. The price is the level at which a willing buyer and a willing seller agree to trade, based on the orders in the book. When more people want to buy than sell at the current price, it tends to rise, and the reverse is also true.

Do I buy shares from the company or from other investors?

In the secondary market, which is where most trading happens, you buy from another investor, not from the company. The company only receives money when it issues new shares, such as in an IPO or a share offering. Later trades between investors do not add money to the company's accounts.

What is the difference between clearing and settlement?

Clearing is the process of confirming trade details, netting obligations and managing the risk that one side fails to deliver. Settlement is the actual transfer of shares to the buyer and cash to the seller. Settlement usually happens a day or two after the trade, depending on the market.

Are market makers a risk to ordinary investors?

Market makers generally improve liquidity and narrow spreads, which helps ordinary investors. They are paid through the spread, which is a real cost, and they can widen quotes or step back during stressed conditions. Regulators supervise their conduct, but they do not eliminate price risk for you.

Does regulation protect me from losing money?

No. Regulators aim to ensure fair dealing, disclosure and sound handling of client assets, and some countries run compensation schemes if a regulated firm fails. They do not guarantee that an investment will keep its value, so ordinary market losses remain your risk.

Continue learning

Educational content only — not investment, tax or legal advice. See our disclaimer.