Afghanistan was never ours to hand over to anyone. That's the point. We never had control over its future in the first place. 20 years and uncountable piles of money and it got us no say whatsoever in what happens to Afghanistan next.
It was all an illusion in the first place. Get with the real world, for Christ's sakes.