FOUNDATIONS

How the Stock Market Actually Works

Behind every ticker symbol is a real piece of a real business, and behind every trade is a surprisingly elegant matching machine. This guide opens the hood: shares, exchanges, orders, spreads, indexes, IPOs, and what genuinely moves prices.

Beginner16 min readUpdated 2026

What a share actually is

A share of stock is a fractional ownership claim on a corporation. Own one share of a company with 1 billion shares outstanding and you own one billionth of the whole enterprise: its factories, brands, cash, patents, and its future profits. This is not a metaphor. Shareholders legally elect the board of directors, vote on major decisions, and hold the residual claim, meaning whatever value is left after employees, suppliers, lenders, and the tax authority are paid belongs to them.

That last point explains both the upside and the risk. Being the residual claimant means your slice can grow without limit as profits grow, and it also means you are last in line if things go wrong. In a bankruptcy, bondholders and other creditors get paid before shareholders, who often receive nothing. Higher risk, higher historical reward: this ordering is the deep reason stocks have out returned bonds over the long run.

Key idea When you buy a share, you are not buying a lottery ticket or a blip on a chart. You are buying a claim on a stream of future business earnings. Every valuation debate in finance is ultimately an argument about the size, timing, and riskiness of that stream.

Shares today are almost entirely electronic book entries. Your broker holds them in "street name" on your behalf, recorded through a central depository (in the US, the DTC). Paper certificates are museum pieces. This is why you can sell in seconds: no vault, no courier, just database updates in a tightly regulated system.

Exchanges: the matching machine

An exchange is a marketplace whose entire job is matching buyers with sellers. The two giants in the US are the New York Stock Exchange (NYSE) and Nasdaq, and both are, at their core, enormous electronic order books: continuously updated lists of every outstanding offer to buy (bids) and offer to sell (asks) for each stock, sorted by price and then by time of arrival.

The matching rule is simple and fair: price priority first (a higher bid beats a lower bid; a lower ask beats a higher ask), then time priority (first come, first served at the same price). When a bid and an ask meet at the same price, a trade prints. That is the whole market, repeated millions of times a day.

Two distinctions worth knowing:

  • Primary vs secondary market. The primary market is where companies sell newly created shares to raise money (IPOs, follow on offerings). The secondary market is everything after: investors trading existing shares with each other. When you buy Apple stock, Apple gets nothing; you are buying from another investor. Roughly all daily trading volume is secondary.
  • Exchanges vs other venues. Your order does not necessarily execute on the NYSE floor. US trading is spread across more than a dozen exchanges plus off exchange venues, and many retail orders are executed by wholesale market makers. Regulation requires that you receive a price at least as good as the best publicly displayed quote, called the NBBO (National Best Bid and Offer).
The stock market is not a place. It is a protocol: a set of rules for turning millions of individual opinions about value into one continuously updated public price.

Order types, with examples

An order is an instruction to your broker. The type you choose controls the tradeoff between certainty of execution and certainty of price. Suppose shares of a fictional company, Novira Corp, are quoted at $49.95 bid / $50.05 ask.

Order typeWhat it saysNovira exampleGuarantees
Market order"Buy or sell now at the best available price"Buy 100 shares at market: you likely pay about $50.05 eachExecution, not price
Limit order"Trade only at my price or better"Buy limit at $49.50: fills only if the ask drops to $49.50 or lowerPrice, not execution
Stop order (stop loss)"If the price hits my trigger, send a market order"Own at $50, stop at $45: a drop to $45 triggers a market sellTrigger, then neither price nor execution certainty
Stop limit order"If the trigger hits, send a limit order"Stop $45, limit $44: sells between $45 and $44, but may not fill in a fast crashPrice floor if filled, but may not fill at all

Worked example of the danger in market orders: you place a market buy for a thinly traded small cap at 9:30 sharp. The last trade was $20.00, but the opening order book is sparse: 200 shares offered at $20.10, then nothing until $21.50. Your 500 share market order takes the $20.10 shares and fills the rest at $21.50, an average of about $20.94, nearly 5% above the last price you saw. A limit order at $20.15 would have partially filled and left you in control.

Worked example of the danger in stop losses: you own Novira at $50 with a stop at $45 "to limit losses." Overnight, a scary but survivable headline drops. The stock opens at $41. Your stop triggers at the open and sells at roughly $41, not $45, because a stop becomes a market order once triggered. The stock recovers to $48 by Friday. Your "protection" locked in the worst price of the week.

Key idea Practical defaults for long term investors: use limit orders for anything thinly traded, near the open or close, or in volatile tape. For large, liquid ETFs and stocks during calm midday hours, a market order is usually fine, the spread is a penny or two. Stop losses are a trading tool, not an investing tool.

Orders also carry a time in force: day orders expire at the close if unfilled, GTC (good till canceled) orders rest for up to 60 to 90 days depending on the broker. Some brokers offer extended hours flags, discussed below.

The bid/ask spread

At any moment a stock has two prices. The bid is the highest price anyone currently offers to pay. The ask (or offer) is the lowest price anyone will currently sell for. The gap between them is the spread, and it is the invisible transaction cost of trading, even in a world of "zero commission" brokers.

Example: Novira is $49.95 bid / $50.05 ask, a 10 cent spread. If you buy at the ask and immediately sell at the bid, you lose 10 cents per share, about 0.2%, with the stock itself unchanged. On a $10,000 round trip that is $20, gone. Now scale by behavior: an investor who trades that position monthly pays the spread 12 times a year, roughly 2.4% in silent friction. A buy and hold investor pays it once.

SecurityTypical spreadRound trip cost on $10,000
Mega cap stock or major index ETF$0.01 to $0.02 (about 0.01% to 0.05%)$1 to $5
Mid cap stock0.05% to 0.2%$5 to $20
Small cap or niche ETF0.2% to 1%+$20 to $100+

Spreads widen when uncertainty is high (around news, at the open, during crashes) and when trading volume is thin. This is one more reason boring, liquid, broad market funds are cheap to own: their spreads are as close to zero as markets get.

Market makers

Who is on the other side when you want to trade at 2:47 pm on a random Tuesday? Often not another long term investor but a market maker: a firm whose business is continuously quoting both a bid and an ask, standing ready to buy from sellers and sell to buyers all day long. They profit from the spread, buying at the bid, selling at the ask, thousands of times over, while managing the inventory risk of holding stock in between.

Market makers are why you can sell 100 shares in half a second instead of waiting hours for a matching buyer to show up. They provide liquidity, the ability to trade quickly without moving the price. In exchange they earn the spread, which is why spreads exist at all.

One retail specific detail: many brokers route retail orders to wholesale market makers under an arrangement called payment for order flow (PFOF). The wholesaler pays the broker for the orders and typically fills them at or slightly inside the public best quote (called price improvement). This is how zero commission trading is funded. Critics argue it embeds conflicts of interest; defenders point to the price improvement statistics. Either way, execution is regulated: you cannot legally be filled worse than the NBBO.

Watch out "Zero commission" never meant "zero cost." The spread, PFOF economics, and, above all, the taxes and mistakes that frictionless trading encourages are the real costs. The cheapest trade is usually the one you did not make.

The major indexes

An index is a measuring stick: a rules based basket of stocks whose combined value summarizes some slice of the market. You cannot buy an index directly, but index funds and ETFs replicate them cheaply, which is why these four names matter to every investor.

IndexWhat it tracksWeightingWhat it is good for
S&P 500About 500 of the largest US companies, roughly 80% of US market valueMarket cap weightedThe default benchmark for "the US stock market"
Nasdaq Composite / Nasdaq 100Stocks listed on Nasdaq; the 100 largest non financial ones for the Nasdaq 100Market cap weightedA tech and growth heavy read on the market
Dow Jones Industrial AverageJust 30 large well known US companiesPrice weighted (a quirk of its 1896 origins)Headlines and history; too narrow and oddly weighted for benchmarking
Russell 2000About 2,000 US small cap stocksMarket cap weightedThe standard gauge of small company performance

Market cap weighting means bigger companies count more: if a company is 6% of total S&P 500 value, it is 6% of the index. The Dow's price weighting is genuinely strange: a $400 stock moves the index four times as much as a $100 stock regardless of company size, which is why professionals quote the S&P 500 instead.

Worked example of why weighting matters: imagine a two stock index holding MegaCorp ($900 billion market cap) and MiniCo ($100 billion). Cap weighted, MegaCorp is 90% of the index. If MegaCorp rises 10% and MiniCo falls 10%, the index gains 9% minus 1%, or +8%, even though the "average stock" was flat. This is also why a handful of giant companies can drive most of the S&P 500's return in a given year.

IPOs: how companies go public

An initial public offering is the moment a private company first sells shares to the public and lists on an exchange. The mechanics: the company hires investment banks (underwriters) who value the business, write a disclosure document (the prospectus, filed as an S-1 with the SEC), market the deal to institutional investors in a roadshow, set an offering price, and allocate the new shares, mostly to those institutions. The next morning, the stock opens for trading and the secondary market takes over.

Companies go public to raise growth capital, to let founders and early investors cash out over time, and to gain acquisition currency and prestige. Alternatives include direct listings (list without raising new money or using traditional underwritten allocation) and the SPAC merger route (merging with an already listed shell company), which surged around 2020 and 2021 and then largely fell out of favor after poor results.

Watch out IPO first day pops make headlines, but the long run record of buying IPOs at the open is historically poor on average: newly public companies as a group have tended to underperform the market in their early years. The people who get the famous first day gain are mostly the institutions allocated shares at the offer price, not the public buying at the open. Also note insider lockups: early holders are typically barred from selling for about 180 days, and lockup expirations can pressure the price.

Market capitalization

Market cap is the total market value of a company's equity: share price times shares outstanding. It is the correct measure of company size; the share price alone tells you nothing. A $900 stock with 10 million shares is a $9 billion company; a $9 stock with 10 billion shares is a $90 billion company, ten times larger.

Worked example: Novira Corp trades at $50 with 2 billion shares outstanding, a $100 billion market cap. Its rival trades at $500 but has only 40 million shares: a $20 billion company. The "expensive looking" $500 stock is the far smaller business. Never compare share prices across companies; compare market caps and valuation ratios.

The conventional size tiers (boundaries are fuzzy and drift upward over time):

  • Mega cap: roughly $200 billion and above.
  • Large cap: roughly $10 billion and above.
  • Mid cap: roughly $2 billion to $10 billion.
  • Small cap: roughly $250 million to $2 billion.
  • Micro cap: below roughly $250 million, often thinly traded and volatile.

Size correlates with behavior: large caps tend to be steadier with global revenues; small caps are more volatile, more domestic, and more sensitive to credit conditions and recessions, with a long historical record of higher but bumpier returns.

Dividends and buybacks

Profitable companies must decide what to do with their earnings: reinvest in the business, pay down debt, acquire other companies, or return cash to shareholders. The two return mechanisms are dividends and buybacks.

Dividends are direct cash payments, usually quarterly in the US. Own 300 shares of a company paying $0.75 per share per quarter and you receive $225 every three months, $900 a year. On a $60 stock that is a 5% dividend yield ($3 annual dividend divided by $60 price). Four dates matter: declaration (announced), ex dividend date (buy before this date to receive the payment), record date, and payment date. On the ex dividend morning, the share price opens lower by roughly the dividend amount, which is why buying the day before the ex date is not free money.

Buybacks (share repurchases) return cash indirectly: the company buys its own shares on the open market and retires them, shrinking the share count so each remaining share owns a larger slice of the same business. Example: a company earning $10 billion a year with 5 billion shares has earnings per share of $2.00. It repurchases 250 million shares (5% of the total). Earnings are unchanged, but EPS rises to $10B divided by 4.75B shares, about $2.11, a 5.3% increase per share without the business growing at all.

DividendsBuybacks
Cash in your pocketYes, automaticallyNo, unless you sell shares
Taxes (taxable accounts)Taxed the year received, whether you wanted the cash or notDeferred until you choose to sell; generally more tax efficient
Flexibility for the companyCuts are punished brutally, so dividends are sticky commitmentsEasily paused or resumed
Main criticismTax drag, may signal lack of growth ideasOften executed at high prices; can flatter EPS and offset stock compensation

Both are the same economic act, returning owner cash to owners, differing mainly in taxes, flexibility, and signaling. Total shareholder return counts price appreciation plus dividends, and reinvested dividends have historically contributed a large share of long run stock returns.

What actually moves prices

Minute to minute, a price moves for exactly one mechanical reason: the balance of buy and sell orders shifted. But behind those orders sit real drivers, operating on different time scales:

  • Expectations vs reality. The key insight of markets: prices already contain the consensus forecast. A company can report 20% profit growth and drop 8%, because the market expected 25%. News moves prices only by the amount it differs from what was expected. This is why "obviously great company" and "great stock to buy" are different claims.
  • Earnings, over the long run. Across decades, stock prices track business earnings power. Everything else is a fluctuation around that trend line.
  • Interest rates. Rates are gravity for asset prices. When rates rise, future profits are worth less today (they are discounted more heavily), and bonds become tougher competition for stocks. Long duration growth stocks, whose value sits far in the future, are the most rate sensitive.
  • The macro flow. Inflation prints, jobs reports, central bank meetings, geopolitics: all filtered, again, through expectations.
  • Sentiment and flows. Fear, greed, forced selling, index rebalancing, options positioning. In the short run the market is a voting machine; in the long run, a weighing machine, as the old Benjamin Graham line has it.
Key idea Daily price moves are mostly noise, unexplainable even in hindsight. Long term price moves are mostly earnings and interest rates. The entire discipline of long term investing consists of ignoring the first category while staying exposed to the second.

Market hours and settlement

US exchanges hold regular sessions from 9:30 am to 4:00 pm Eastern, Monday through Friday, closed for about nine market holidays a year plus occasional half days (typically 1:00 pm closes around Thanksgiving and Christmas). The two bookends are special: opening and closing auctions batch huge volumes into single crossing prices, and the 4:00 pm closing auction sets the official price used by index funds, which is why the last minutes of the day are the heaviest.

Extended hours trading runs before the open (premarket, as early as 4:00 am) and after the close (until 8:00 pm) on electronic networks, and some brokers now offer overnight sessions in popular names. Liquidity is thin, spreads are wide, and prices can gap; earnings announcements deliberately drop outside regular hours, producing wild after hours moves on small volume. If you must trade extended hours, limit orders are essentially mandatory.

Settlement is the back office completion of a trade: cash and shares officially change hands. Since May 2024, US stocks and ETFs settle in one business day, called T+1: sell on Tuesday and the cash is officially yours Wednesday. Practical effects: proceeds may be withdrawable only after settlement, dividend eligibility follows settlement mechanics, and in cash accounts, spending unsettled proceeds on a new buy and selling again too quickly can trigger a good faith violation. For a monthly index fund buyer, settlement is invisible plumbing; it only bites active traders.

You now know the machinery: what a share is, how the matching engine works, what the quotes mean, and what moves them. The next guide zooms in on the asset class itself: stocks, in full.