Afghanistan is barely a country. It hardly has a national identity, and it can't be made to surrender formally, because there's no single clique which can be forced to accept defeat on behalf of the population.
Even Yugoslavia is different, because it spent enough time as a Soviet vassal state to develop a central structure.
Pacifying Afghanistan is like trying to pacify an amoeba. There's no central point to hold onto, and without that political leverage it will always keep growing back at you from all directions.