Counter-intuitive as it may sound, it is very difficult to predict the near-term future when it comes to investing. This is not to say that it is difficult to predict if a given stock will go up or down the next day when some news is heard. If a scandal breaks out, obviously the stock will fall in price. Likewise, if a large drug company gets a new wonder drug approved, the stock will go up. Sometimes even in these situations a stock will still trade in an unpredictable way. This occurs when the price of the stock has already gone up so much on the expectation that the drug would be approved that it falls a bit after the actual announcement comes. (This behavior is the reason for the old axiom, "buy on the rumor, sell on the news".) But in general the reaction of a stock's price to news is fairly predictable.
The issue is that just as you can predict the direction of the stock due to the news, so can everyone else. You will therefore never be able to profit off of the news since you'll be in a long line to buy or sell the shares, and the people on the other side of the trade will have heard the same news and adjusted their prices accordingly. For a mainstreet example, if you owned a house on the outskirts of town, the price might be $150,000. If word comes out, however, that a new business park is going to be built in the area that will cause a lot of people to want to live on that side of town, the price might jump to $250,000 overnight. If you are that homeowner, unless you did not hear the news about the new business park and your real estate broker is equally clueless, you would not still price your house at $150,000. You would want at least $240,000. You might even think that the price may climb higher and not sell for less than $280,000. As in real estate, just because a stock traded at a given price one day does not mean it will trade at that price again after news breaks out. The person selling the shares hears the same news as the buyer.
All news that affects the long-term is not priced into stocks instantly, however. While everyone has the same information and is able to do the same analyses, there still tend to be differences in price between what a company trades at and what it should be trading at given its future earnings. The reason for this is that it is more difficult to predict future earnings with certainty, so there is a "risk premium" included in the price. One may expect earnings to increase by 15% annually over then next 5 years, which would cause the stock price to rise by about 15% per year, but things may happen that cause earnings to only increase by 5% or even fall. Because there is no guaranteed rate of return, and an actual risk of loss of capital, investors demand a greater potential return and price the stock accordingly.
Despite this uncertainty, enough predictions of future earnings come true to allow investors to chose stocks that have a propensity for growing in earnings and price at a rate far greater than what can be received from low-risk investments like a bank account. It is normally fairly easy to pick stocks that will probably be worth more in the future (due to future earnings and dividends) and yet the price of the stock will not always fully take in these future earnings into account. Buy buying a set of good prospects, the chances are good that one will outperform the markets, which are made of both good and not-so-good prospects.