How do stocks earn money?
Investors make money from stocks via growth and dividends.
Growth
A fancy finance phrase for growth is capital appreciation, which is the classic "buy low, sell high" that people rattle off when asked about what they know about finance. The difference between what it cost to buy a stock at and what the stock sells for is the profit.
Almost like trading cards, stocks are "traded" as there are people buying and selling stocks. People might sell stocks because they've felt that they've made a good profit from their initial investment, or they might be selling because they feel that the company associated with the stock is due for a downturn. People might buy because they're looking at a company that's holding steady or somewhat floundering now, but have a good hypothesis that the stock will appreciate greatly over time due to views they might hold that the seller doesn't.
A stock might be valuable one day and then crash the next, never to recover, for a laundry list of reasons. Maybe the company went bankrupt and was delisted. Perhaps there was a scandal in the company that heavily impacted their image and while the company still was around and making profit, it was nowhere near as fiscally valuable as it used to be and very likely will never be anywhere near as strong ever again.
There's a very human element to account for when investing in stocks. Sentiment can drive prices up and down, whims of executives can make or break entire companies (stocks), the list goes on; it's definitely tricky to navigate this kind of playing field.
Dividends
The other way stocks make money for their holders is providing dividends. It's regular and passive income purely by virtue of owning the stock, where the company associated with the stock will throw the holder a kickback for investing in and sticking with the company.
When one owns stock in a company, the holder is technically considered a partial owner of the company: they've put money into the company and therefore should be allowed to have some kind of say as to where the company goes. These dividends are paid out quarterly. Yes, this has to do with that "fiscal year" thing where there are 4 quarters, one for each part of the year.
This sounds like a sweet deal, right? Not all companies have stocks that pay dividends, and a company can choose to reduce dividends or cut them out altogether. The latter will happen during tough economic times, either for a given company or the entire market.
The payoff
Growth-focused stocks are really good at being "performance" stocks, where the share value of the stock is on a very solid upward trajectory, or it has a habit of dipping slightly and then holding at a higher value. Having a portfolio of just growth stocks means you have to keep an eye on the market every single day in order to trade for good money.
Dividend-focused stocks have the raw payout factor, where it's known that there's gonna be a paycheck at the end of the quarter. Stockpile a few of those, have some nice passive income from dividends: sounds nice, right? However, the rug can easily be pulled out from under you depending on how well or poorly the company is doing, sometimes it might be pulled out from under you for no reason.
Having both is the key to making long-term and consistent money.