How the stock market works: exchanges, orders and prices

The stock market is where shares are issued and traded. Learn how exchanges, order types, the bid-ask spread, price discovery and stock indexes actually work.

Stock market cover reading How the stock market works, with a bar chart of one day's index change under three weighting methods: 6.0% price-weighted, 0.615% cap-weighted and 2.333% equal-weighted.

The stock market is a network of exchanges and trading venues where buyers and sellers trade shares of companies.

Its prices shape retirement savings, company funding and the headlines people see each evening.

This guide explains the mechanics: how shares are issued, how orders meet and how prices and indexes form.

Key takeaways

  • Companies raise money in the primary market; investors trade existing shares in the secondary market.
  • Exchanges and other venues match buy and sell orders under published rules.
  • Market orders favor speed; limit orders favor price control.
  • The bid-ask spread is a real trading cost, larger for thinly traded shares.
  • Indexes summarize many prices, but their weighting method changes the result.

What is the stock market?

A share, or stock, is a unit of company ownership, with a claim on its profits and assets.

The stock market is the set of places and systems where those shares are bought and sold.

In the United States, trading is spread across many exchanges and alternative venues linked electronically.

What the market does

  • Raises capital: companies sell new shares to fund growth.
  • Provides liquidity: owners can sell shares quickly to someone else.
  • Discovers prices: trading reveals what investors collectively think shares are worth.
  • Spreads risk: ownership is shared among many investors rather than a few.

What is the difference between the primary and secondary market?

The primary market is where a company sells newly created shares to investors and receives the money.

The secondary market is where investors trade those shares with each other afterward.

The primary market and IPOs

A company’s first sale of shares to the public is an initial public offering, or IPO.

Investment banks, acting as underwriters, help set the offer price and sell the shares to investors.

The company must publish a detailed disclosure document so investors can judge the business.

Worked example: a fictional IPO

Lakeside Tools Inc., a fictional manufacturer, sells 10,000,000 new shares at $20 each.

Gross proceeds are $200,000,000. Assume underwriting fees take 6%, or $12,000,000.

Lakeside receives about $188,000,000 to fund new plants, before other offering costs.

The secondary market

Once listed, Lakeside’s shares trade between investors. The company receives nothing from those trades.

Still, secondary prices matter to it. They affect the cost of raising more money later.

Most daily stock market activity, and almost all price headlines, come from the secondary market.

What do stock exchanges and other trading venues do?

An exchange is a regulated marketplace that brings buy and sell orders together and matches them.

Exchanges also set listing standards that companies must meet to have their shares traded there.

Types of venues

  • Exchanges: display orders publicly and match them by price and time priority.
  • Alternative trading systems: private venues that match orders with less public display.
  • Wholesalers: firms that execute many retail orders directly from their own inventory.

Prices across venues are linked. Quotes are consolidated so brokers can see the best available prices.

Brokers route each order to the venue they judge offers the best overall terms.

Trading hours and auctions

Exchanges often open and close the regular session with auctions that gather orders at one price.

These auctions help set official opening and closing prices that many funds use for valuation.

Who takes part in a trade?

A single trade can pass through several hands, each with a defined role.

  • Investors: individuals, pension funds, mutual funds and insurers buying or selling.
  • Brokers: firms that route customer orders to venues for execution.
  • Market makers: firms quoting both a buy and a sell price, ready to trade.
  • Exchanges and venues: systems that match the orders.
  • Clearing houses: central bodies that guarantee and settle completed trades.

Why market makers matter

Market makers supply liquidity. A buyer can trade now without waiting for a natural seller to appear.

They earn the spread between their buying and selling prices, while taking the risk of price moves.

What are the main order types?

An order tells a broker to buy or sell a set number of shares under stated conditions.

Market orders

A market order asks to trade immediately at the best available price. Execution is likely; price is not guaranteed.

In fast markets, the final price can differ noticeably from the last quote seen.

Limit orders

A limit order sets the worst acceptable price: a maximum to pay, or a minimum to receive.

It protects the price, but the order may fill only partly, or not at all.

Stop and stop-limit orders

A stop order becomes a market order once the price reaches a chosen trigger level.

A stop-limit order becomes a limit order at the trigger, so it may not fill in a sharp move.

Time instructions

  • Day order: expires if unfilled at the end of the trading day.
  • Good-till-canceled: stays open until filled or canceled, subject to broker limits.
  • Immediate-or-cancel: fills what it can at once and cancels the rest.

What are the bid, the ask and the spread?

The bid is the highest price a buyer is currently willing to pay for a share.

The ask, or offer, is the lowest price a seller is currently willing to accept.

Bid-ask spread = best ask − best bid; midpoint = (best ask + best bid) ÷ 2

If Lakeside’s best bid is $50.00 and best ask $50.05, the spread is $0.05.

The midpoint is $50.025, so the spread is about 0.10% of the midpoint price.

What drives the spread

  • Trading volume: heavily traded shares usually have narrow spreads.
  • Volatility: wider spreads compensate market makers for faster price swings.
  • Uncertainty: spreads widen around major announcements or unusual news.
  • Share price level: a one-cent spread is a larger share of a low price.

Someone who buys at the ask and immediately sells at the bid loses the spread.

How does price discovery work through the order book?

An order book lists waiting limit orders to buy and sell, ranked by price and then by arrival time.

Prices move when new orders consume the waiting orders at one level and reach the next.

Worked example: Lakeside’s order book

Here is a simplified, fictional snapshot of the book for Lakeside Tools shares.

Bid size (shares) Bid price Ask price Ask size (shares)
400 $50.00 $50.05 300
600 $49.98 $50.06 500
1,000 $49.95 $50.08 800

Mr. Alvarez, a fictional investor, sends a market order to buy 1,200 shares.

His order takes all shares at the first two ask levels, then part of the third.

Fill price Shares filled Cost
$50.05 300 $15,015.00
$50.06 500 $25,030.00
$50.08 400 $20,032.00
Total 1,200 $60,077.00

His average price is about $50.0642 per share, above the $50.05 best ask he first saw.

Compared with buying all 1,200 at the best ask, he pays $17.00 more.

Compared with the $50.025 midpoint, his total cost is $47.00 higher. That is his trading cost.

After his order, the best ask becomes $50.08, with 400 shares left. The visible price has moved.

The limit order alternative

Had he used a limit order at $50.06, he would have bought 800 shares at an average of $50.0562.

The remaining 400 shares would rest in the book as a new best bid at $50.06.

He gains price control but risks never buying the rest if the price rises.

What happens after a trade is executed?

Execution is the matching of a buy and a sell. Settlement is the actual exchange of cash and shares.

Clearing

A central clearing house steps between buyer and seller, becoming the counterparty to each side.

That way, if one firm fails, the other side of its trades is still protected.

Clearing members post collateral, which the clearing house can use to cover a default.

Settlement

Settlement happens a short, standard number of business days after the trade date, set by market rules.

Shares are held electronically, and the investor’s broker records the ownership on their behalf.

Trade reporting

Completed trades are reported and published, which feeds the last-sale prices shown on quote screens.

How do stock market indexes work?

A stock index tracks the combined price performance of a chosen group of shares.

It turns thousands of price changes into one number that shows the market’s direction.

Weighting methods

  • Price-weighted: higher-priced shares carry more weight, whatever the company’s size.
  • Market-cap-weighted: larger companies by total market value carry more weight.
  • Equal-weighted: every company counts the same, rebalanced periodically.

Market capitalization = share price × shares outstanding

Worked example: one day, three methods

Consider three fictional companies over one day. Each index starts at 1,000.

Company Price before Price after Daily change Shares (millions) Market cap before ($ millions)
Company A $120.00 $132.00 10.0% 50 $6,000
Company B $40.00 $38.00 (5.0%) 300 $12,000
Company C $10.00 $10.20 2.0% 800 $8,000
Index method Index after Daily change
Price-weighted 1,060.00 6.0%
Market-cap-weighted 1,006.15 0.615%
Equal-weighted 1,023.33 2.333%

Company A has the highest price, so it dominates the price-weighted index with 70.59% of the weight.

In the cap-weighted index, the larger Company B holds 46.15% weight, so its fall offsets much of A’s gain.

Same day, same shares, three different headlines. Always check how an index is built.

Common mistakes

Most misunderstandings come from treating the market as one price instead of many competing orders.

  • Assuming the last price is available: the next trade happens at the current bid or ask.
  • Ignoring the spread: it is a cost on every round trip, even with zero commission.
  • Using market orders in thin shares: large orders can walk through several price levels.
  • Confusing primary and secondary trades: companies receive money only from new share sales.
  • Reading an index without its method: weighting can change the day’s story.
  • Treating stops as guarantees: a stop order can fill well below its trigger.

Frequently asked questions

Who sets the price of a share?

No single person does. The price is where the latest buyer and seller agreed to trade.

It changes as new orders arrive and investors update their views of the company’s prospects.

Does a company make money when its share price rises?

Not directly, since secondary trades are between investors. A higher price can make future fundraising cheaper.

It can also raise the value of shares the company uses to pay staff or buy other firms.

Why might an order fill at a different price than shown?

Quotes change in fractions of a second, and the displayed size may be smaller than the order.

A market order then fills at the next available prices, which can be worse.

What is market depth?

Depth is the number of shares waiting at prices near the best bid and ask.

A deep book absorbs large orders with little price change; a shallow book moves sharply.

Sources

Read next

This article is for general education, not financial, investment, legal or tax advice.

All companies, investors, share prices, order sizes, fees and index figures are fictional assumptions for illustration.

Updated: (GMT+7)8 min read