The Efficient Market Hypothesis (EMH) states that it is impossible to beat the market consistently over time, since all available information is priced efficiently into stock prices.
But what the EMH misses is the impact that sentiment can have on price discrepancies in the short-term. Emotions can lead to gross mis-valuations (as we saw with the tech bubble in 2000), and market corrections can see stocks selling off dramatically for no fundamental reason.
Over time, the market moves back to fair value based on available information, but many factors can throw it off course along the way. Investors that can consistently capitalize on price mismatching can add value over the market in the long-term.
That being said, it is quite rare for someone to have a very long-term track record of beating the market.