Rare earth metals aren’t actually rare, the problem is extracting them from soils cost effectively. I understand it can be a messy process as well.
Oil and other minerals usually occur in one location as singular deposits. Rare earths need to be extracted from large amounts of soil. The US has always had viable reserves of oil, coal and gold.
China has dominated this market because they are prepared to spend non profitable time processing soil for these minerals whereas Americans aren’t.
I think there’s some US rare earth extraction in the mid west.