The “law of supply and demand” is a feature of economic models with supply and demand curves. These are usually mainstream equilibrium models. It is somewhat difficult to relate these models to real world behaviour. I am in a theoretical camp that is critical of such models; perhaps someone else can give a better account.
As for your questions about stock prices, you probably would need to look at the mechanics of stock trading. Investors post prices at which they are willing to buy or sell, and then others will transact at those prices. (In some cases, market makers are the ones posting the price.)
Those participants can change their posted prices whenever they want, typically in response to news. The prices can move without a single share trading hands. This can be interpreted as a shift in the supply or demand curve.
If someone has a big order to buy or sell, they can clear out the first set of posted prices, and transact against other orders. This will result in a price change. For example, assume there are orders to buy 100 shares at \$10 and \$5. An order to sell 200 shares would first clear the best bid (\$10) and then hit the next bid (\$5). In this way, big orders can change prices.
A longer version of this example.
- There are no existing orders for shares in a company.
- Investor A puts in a bid to buy 100 shares for \$5. The best bid (highest bid) is now \$5.
- Investor B puts in an order to buy 100 shares for \$10. The best bid is now \$10. The bid price solely as the result of the new order; there was no transaction that moved the price.
- Investor C wants to sell, and puts in an order to sell 200 shares. The first 100 shares clears B’s bid at \$10, and the second 100 clears A’s bid at \$5. The prices at which transactions happened was the result of an order clearing out the existing order.