An externality is a missing price tag. More precisely, it is the economists' term for when the price of a product does not reflect its true economic cost or value.
The classic negative externality is environmental damage, which reduces the value of natural resources without raising the price of the product that harmed them. The classic positive externality is technological spillover, where one company's inventing a product enables others to copy or build upon it, generating wealth that the original company can't capture.
If prices are wrong due to positive or negative externalities, free trade will produce suboptimal results.
For example, goods from a nation with lax pollution standards will be too cheap. So its trading partners will import too much of them. And the exporting nation will export too much of them, overconcentrating its economy in industries that are not really as profitable as they seem, due to ignoring pollution damage.
Positive externalities are also a problem. If an industry generates technological spillovers for the rest of the economy, then free trade can let that industry be wiped out by foreign competition because the economy ignored its hidden value. Some industries spawn new technologies, fertilize improvements in other industries, and drive economy-wide technological advance; losing these industries means losing all the industries that would have flowed from them in the future.