Or, just get lucky.
The only personal example I have is from buying NFLX stock about a decade ago. I saw a news (Slashdot I think) story that Netflix's servers were having an hours-long outage. I can't remember if it was mentioned in the story that their stocks took a dip, or I just happened to look. Either way, I noticed that their stocks were down about 30% on that news, which seemed silly to me. The market was treating this like it was some kind of disaster for the company, whereas I was pretty confident it was a temporary blip.
I bought the stock, just a few hundred worth since I was in my first barely-over-minimum wage job at the time. Netflix got their servers running again, and the stock recovered the next day. I decided to hold on to the stock because, why not? Today, it's worth about 20x what I bought at.
If only I'd bought more.
My point is, I knew that the market was wrong, and an hours-long server outage wasn't a reason for Netflix to suddenly be worth 30% less than it was the day before.
To successfully pick stocks, you have to have some kind of expertise or insider knowledge to know when the market's wrong, and you're right. Most of us, in most situations, don't have that kind of expertise or insider knowledge.