Afghanistan has been conquered dozens of times lol. It's actually one of the easier places to get. Those mountains don't protect them from invasion, they trap them inside. Like that scene in A Bronx Tale, "now you can't leave."
In order, the following foreign powers rolled over the native occupants (or at least the previous occupants) and ruled Afghanistan:
Achaemenid empire
Macedonian empire
Seleucid empire
Mauryan empire
Indo-Greeks
Parthian empire
Indo-Saka
Kushan empire
Sassanian empire
Hephthalite empire
Abbasid caliphate
Ghaznavid Turks
Seljuk Turks
Khwarezmian Turks
Mongol empire
Timurid empire
Safavid empire
Mughal empire
Ashfarid dynasty
That's 19 conquests by my count, spanning a period of 2200 years of history. I'm probably missing a few since my post-Timurid history of south Asia isn't very comprehensive. So Afghanistan was basically conquered once every century, 22 centuries in a row. It just isn't a difficult place to go for a foreign army.
Credit to them for doing a good job in the last 150 years or so though, they kept out the British and the Russians and now they've sent the Americans home empty-handed too