A stock is a small share of a company. By buying it you become a shareholder: you own a piece of the company and benefit from its success… or suffer its difficulties.
A stock’s price depends mostly on the company’s results and on what investors expect from it. Good news that was already expected may change nothing; a surprise moves the price.
Some companies pay a dividend: part of their profits paid out to shareholders. The stock exchange is the organised market where these shares are bought and sold.
Examples
DELTA-X (fictional market) : Imagine DELTA-X publishes its results in the middle of this chart: the price drops at once then slowly recovers. That is typical of a negative surprise followed by the market digesting it.
Meta, 3 February 2022 : After results judged disappointing (fewer users than expected), Meta (Facebook) stock lost about 26% in one session, wiping out more than 200 billion dollars of value.