Some of it owes to general market psychology
The market is driven by literally millions of investors. What one person thinks is a great company, another ignores. And if enough investors ignore a company, its success doesn't translate to price action.
There's also the question of exactly what constitutes a great company
At first glance, strong fundamentals would seem like a logical definition. But if that were the case, investing would be pretty easy. Simply pick the companies with the strongest fundamentals, invest your money and wait for the elevator to rise.
Let's take a look at some of the reasons a great company isn't always a great investment
The company is being ignored by Wall Street
A company stock price doesn't take off just because it's a good company. It takes off mainly because it's drawing investor interest. Since so much of the market today is held in mutual funds and exchange-traded funds (ETFs) or institutional positions like pensions and insurance companies, investment flows are largely driven from the top down.
A great company can still have an excessive valuation
This is the exact opposite of the above situation. A company could be so popular with institutional investors, that the stock price can rise to levels that may not be sustainable.
Profitability doesn't guarantee stock price growth
Many of the most popular stocks have little or no earnings.
Good companies can still be taken down by falling markets
No matter how good a company is, its stock price can still decline in a falling market.
Too many shares of stock outstanding
A great company may have too many shares of stock outstanding.
The company is in a declining industry
No matter how great a company is, investors are likely to avoid its stock if it's in a declining industry.
The company may potentially be facing a scary contingency
Often the biggest factor affecting the price of a company's stock is taking place outside the company itself.
Final thoughts on why a great company isn't always a great investment
The fact that great companies aren't always great investments emphasizes the reality that investing isn't easy. This is a major reason so many investors choose mutual funds and ETFs, instead of direct ownership in individual companies.
Even if you do all your research and identify companies that look like “can't miss” opportunities, they may very well miss anyway. And often for reasons you never considered.