Most people picture a stock market as a building full of shouting traders. What it actually is, today, is a set of rules plus a lot of computers doing three separate jobs that get blurred together in most explanations:

  1. Let a company sell new shares once, to raise cash. This is the primary market.
  2. Let investors trade those shares with each other, continuously, ever after. This is the secondary market — the "stock market" in the everyday sense.
  3. Move the money and the shares after the trade, so ownership actually changes hands. This is clearing and settlement, and it's the part almost nobody mentions.

Once you can see those three jobs separately, the confusing questions — who sets the price, where my money goes, why my order filled at a different price than the screen showed — all have straightforward answers.

Rendering

A stock market is two markets sharing one set of pipes

When a company goes public, it sells newly created shares to investors and keeps the cash. That first sale is an initial public offering, or IPO; under U.S. law a company can't offer shares to the public unless the offering is registered with the SEC, which is why an IPO comes with a prospectus describing the business and the deal 4. Investment banks usually buy the shares from the company and resell them to investors, and the company applies to list its shares on an exchange such as the NYSE or Nasdaq 14.

The important consequence: that money goes to the company once. From then on, when you buy that stock, you are buying from another investor, not from the company. The company gets nothing from your purchase, and it isn't a party to your trade 2. The secondary market's job is not to fund businesses; it's to let owners of shares convert them into cash quickly, and to let everyone agree on a price.

Who sets the price? Buyers and sellers, one order at a time

No committee, exchange, or company sets a stock's price. Prices emerge from standing orders.

Think of the order book as two queues. On the buy side sit limit orders — instructions to buy only at a stated price or lower. On the sell side sit limit orders to sell at a stated price or higher. The highest price any buyer is currently willing to pay is the bid; the lowest price any seller will currently accept is the ask (or offer). The gap between them is the spread 3.

If the best bid is $49.98 and the best ask is $50.02, no trade happens at $50.00: nobody is offering to sell there. A trade happens only when an incoming order is willing to cross the gap — a buy order that will pay $50.02 meets a seller asking $50.02, and they trade. That price becomes the "last trade" price you see quoted. The price tickering past on a stock is not a valuation someone calculated; it is the price of the most recent completed trade 5. Orders from competing venues are also combined into one best-price picture, so "the market" is never one single place.

This is where risk and return in stocks actually come from. Because nothing anchors the price to a computed fair value, the return you eventually get depends on what some future buyer is willing to pay, plus any dividends paid along the way. Prices move when the next person's willingness to buy or sell changes — after an earnings report, an interest-rate surprise, or just a shift in mood. That is why a stock can be worth far more or far less than any spreadsheet says, and why higher expected returns come packaged with the possibility of large losses. The market is a price-discovery mechanism, not a promise.

One practical detail falls out of this: a ticker symbol — the short code like AAPL — is simply the label your broker attaches to an order so it reaches the right security. It says nothing about the company's size or quality.

What really happens when you place a buy order

Here is the full trip, for an ordinary retail order in the U.S.:

1. You submit the order. It carries the ticker, the number of shares, the order type, any price limit, and a time limit (most orders default to "day" and expire at the close if unfilled) 5.

2. Your broker checks and routes it. The firm verifies you have the cash or buying power, then decides where to send the order — a process called routing. The destination is the execution venue 6.

3. A venue executes it. That venue might be a traditional exchange like the NYSE or Nasdaq, where many buyers' and sellers' orders meet; an alternative trading system (ATS), an electronic venue that matches subscribers' orders but isn't an exchange; or a wholesaler, a broker-dealer acting as a market maker that fills retail orders itself, quoting its own two-sided prices 6. All of these are regulated, and your broker owes you a duty of best execution — reasonable effort to get a favorable price under the circumstances, not literally the best price that ever existed.

4. The trade is reported. Exchange trades print to the consolidated tape; off-exchange trades go to a trade reporting facility. You get a confirmation showing shares, price, and any commission or fees 6.

5. Clearing and settlement. Behind the scenes, a clearinghouse compares both sides of the trade, and on settlement day the cash and the shares swap. Since May 28, 2024, most U.S. stock trades settle one business day after the trade date — T+1 — instead of two 7. Your shares are held electronically: your broker's records show your claim, while at the depository level they're held in the broker's name, so no paper certificate changes hands 2.

A detail worth noticing: execution (step 3) and settlement (step 5) happen at different times. Your account displays the trade almost instantly, which is why trading feels instant, while the actual exchange of money and shares is a separate, later step. That gap is also why brokers care whether your cash has settled before you withdraw sale proceeds.

Market order vs limit order: the one choice that changes your fill

The difference between these two is the single most consequential decision in the whole process, and it maps exactly onto the bid/ask mechanics above.

A market order says "buy now at whatever price is available." It is generally executed, but the price is not guaranteed: it fills at or near the current ask, and if the shares offered at that price run out, the rest of your order fills at higher prices 5. With 1,000 shares wanted and only 500 offered at $3.00, the remaining 500 might fill at $3.05. On a thin or fast-moving stock, the gap can be much wider than the spread you saw.

A limit order says "buy only at this price or lower." Your worst case is capped, but execution is not guaranteed — if the price never comes back down to your limit, nothing happens 5. A buy limit at $49.99 in the example above sits unfilled while the stock trades at $50.02. Most brokers let you choose how long it stays alive (day, or good-til-canceled).

The spread you pay is a real, if small, cost of buying. Paying the ask and later selling at the bid means you start slightly behind, which is one reason frequent trading is expensive and long holding periods are not.

What this picture does and doesn't explain

You now have the closed loop: a company raises money once in the primary market; after that, price is set continuously by the standing bids and asks of investors and market makers; your order is routed to one of several venues, executed against those resting orders, reported, and settled a business day later. What a share actually entitles you to, why some investors prefer funds, and how bonds and dividends fit alongside stock returns all build on this foundation rather than replace it.