The Afghanistan thing is an easy narrative, but it isn't really an accurate one. More accurate:
> Two superpowers found that Afghanistan, a fractious nation mostly comprised of illiterate peasants and devoid of exploitable industrial or natural resources, wasn't worth the price of occupying indefinitely.
Fair! It's a two-variable function though. How much is it worth to have? How much does it cost to keep? The Afghanis made the cost very, very high relative to what might be expected.
AIUI, the key word is "exploitable". Natural resources are worthless without the infrastructure to mine them and transport them to somewhere they can be used. Afghanistan, being landlocked, covered in VERY rugged terrain, and with relatively west-hostile neighbors (with lots of their own problems that make "develop port access for Afghanistan" a low priority) is a very difficult geographic place for resource extraction.
> Two superpowers found that Afghanistan, a fractious nation mostly comprised of illiterate peasants and devoid of exploitable industrial or natural resources, wasn't worth the price of occupying indefinitely.