Caspian Report notes that Afghanistan is sitting on $3tn worth of minerals, including rare earths.
Rare earth elements, despite their name, are not particularly rare. However, economically minable deposits are rare. Rare earths are vital to many modern technologies including electronics, lasers, aerospace, high-refractive-index optics, steel alloys, X-ray machines, magnets, etc. Thus they are strategically important. China is currently the world's biggest exporter of rare earths, supplying about 90% of the global demand for the 17 rare earth elements in 2019. The USA very much doesn't want to be dependent on China for its military industries.
$3 trillion is $93,000 for every Afghan, so it's a lot of money and could make Afghanistan wealthy.
However, Afghanistan is mountainous and lacks both internal and external transport links, and the government has little control over vast areas of its territory. All this makes prospecting, mining, refining, and exporting minerals difficult.
Both the USA and China have their eyes on Afghan minerals. Afghanistan will have to be careful not to annoy either superpower, nor its neighbour Pakistan (which Afghanistan is not on particularly good terms with). The USA has asked Turkey to host Afghan peace talks, as Turkey is on good terms with both the Afghan government and the rebel Taliban; possibly these will lead to a power sharing agreement. It is in US interests to leave Afghanistan if it can, but it is very much not in US interests to cede control of Afghan rare earths to China.