The first problem is that funds pay out capital-gain distributions every year and fund investors are taxed on them. In fact, many funds are active traders, and create huge, yet avoidable taxable gains for their shareholders. The funds' results don't reflect tax costs because it is their investors who pay the bill. The disciplined investor might have preferred not to sell a stock at all, instead letting it continue to appreciate without any current tax burden. But that choice is only available to one who buys a stock directly, not through a fund.
Investors face another tax trap when they sell their fund shares.
The rules get particularly tricky when dividends and capital gains are invested in additional fund shares. When it comes time to sell fund shares, many investors don't realize they have a choice in how their basis is calculated. The IRS loves this choice and, unless the investor opts otherwise, the IRS selects this choice for her. This method is often a better choice than FIFO, but not without its drawbacks. For one thing, the investor must get IRS permission to use any other method later, when he sells more shares of the same fund.