Why do share prices go up and down?
Simply put, supply and demand. Buyers offer to buy shares at $X price, and the seller wants to sell their share for $X price.
A ‘trade’ will only occur when a buyer and a seller have the same price. Computers are constantly trying to match up buyers with sellers to execute trades on behalf of the buyers/sellers.
In this example, no-one wanted to buy their share for $10, so they compromised and sold it for $8. In reality, the trading doesn’t happen with in person, but rather through an online broker, and the auctioneer is a computer system.
When there are more buyers than sellers, the price goes up to reflect the demand, and when there are more sellers than buyers, the price can fall.
Note: The price of a share is not to be confused with the value of a share. The price is what people are willing to buy/sell it for, it could be $5, but the value could be $2, $4, $6 or even $10. Accurately valuing a company can be extremely complicated.