One statistic I think gets overlooked is the Afghan population almost doubled from 20M to 38M in the last 20 years. The massive young demographics growing up under occupation was going to come home to roost sooner or later. There's also the geographic reality that Afghanistan is a land locked country and US tenuous access via Pakisan or the even more perilous northern routes meant taming Afganistan was always going to be a long term losing proposition.