Mining (and refining) especially tends to come with some nasty environmental effects that we've been quite happy to outsource to other parts of the world with less empowered citizenry (and often cheaper labor).
Rare-earth elements are the same way - they're relatively abundant, but China is enormously over-represented in the market because the west doesn't like mining and China doesn't care.