Global warming is the same thing. If everyone pollutes, we all die and the world ends. Individually however, if I'm in a world where everyone is burning coal, I don't see any gain to setting up my own wind turbine. Meanwhile everyone who kept burning coal has a slightly better existence until we all die a horrible death. The flipside is also true, if I'm the only one burning coal in a world of wind turbines, I won't have a significant effect on the climate and I get cheaper energy.
The economic solution to this is regulating greenhouse gas emissions so nobody can gain an advantage from burning coal. We all live and businesses make more money (because Earth will still exist to make money on).
It's also possible to do this with non-competes. If a world without them is economically better, we need to put our efforts into banning them globally. It doesn't make sense to only ban them in the US or Canada, because companies can just outsource to where it's acceptable.