What is the mechanism that triggers a stock price change? When discussing with my son basic economics (how the price is driven by demand, among others), I came to wonder which exact mechanism triggers a price change in a stock exchange.
In everyday life, prices are fixed (in practical terms) by the provider (a shop for instance). The consumers either buy it or not, which can drive the provider to lower the price (or not). In any case, there is a trigger (the decision of the owner to set a price) that probes the market.
What is the equivalent in a stock market? Specifically, what exact mechanism modifies the price to get a reaction of the ones who would like to buy or sell stock? I understand that globally the demand drives the price, but once the price is, say, 10 EUR - what triggers a change?

Is it a random mechanism (&quot;we, the stock exchange organization, will fluctuate the price around 10 EUR to see whether more will buy or sell&quot;)?
Or an offer is done by some of the ones who would like to sell or buy (&quot;I will ask around to buy for 9 EUR and see if someone sells&quot;, or &quot;I will set the price of my share to 11 EUR instead of 10 and see if someone buys from me&quot;?)
Or something else?
I won’t discuss the fundamental reasons why stock prices change (discussed in another answer), but the mechanics (roughly) work like this. (Real world is more complex, since there are multiple exchanges, and high frequency trading.)
An exchange matches orders from buyers and sellers. The sensible way of making an order is to put a limit price on it. So you either make a bid up to a maximum price, or sell at a minimum.

If your order cannot be matched to an existing order, it is added to the queue of orders. There is a list of bids (buy orders) and offers (sell orders), which are ordered by price. E.g., if the highest bid is to buy at \$90, a bid at \$100 is better and is added to the front of the queue. (If the order price matches an existing price, the orders are processed first-in, first-out.) No transaction has happened, so there is no recorded stock price change. (Exchanges report the best bid/offer, which might change.)
If your order can be matched (either you pay as much as someone is willing to sell at, or sell at a price people are willing to pay), you buy/sell at the prices specified by the existing orders. E.g., if there were orders to buy 100 shares each at \$100 and \$90, and you are willing to sell 200 at \$90, you first sell at 100, then 90. The pricing history will note the transactions, and the price drops.

Other orders are “market orders,” where you buy/sell at the best offer/bid. In the era of high frequency trading - where the prices move extremely fast - this is surprisingly risky. A market order can be considered to be a bid with a limit of infinity (!) or a sell at 0 (which explains the risk, if orders can jump extremely rapidly). In a market where most orders are market orders, they will account for most of the transactions - limits are set not to trigger a transaction, rather they wait for a market order.
One thing that is often not appreciated is that professional traders will continuously monitor their open orders. They will remove them and add them back at new prices in response to news. This means that the prices can jump without any buying or selling: people can adjust prices without there being any transactions. This effect means that it is safest to think about prices as being set based on traders’ views, and not some mechanical supply and demand effect based on buying and selling flow numbers.