Dan Brioli, one of the big differences between Bosnia and Afghanistan was Tony Blair. He led the mission in Bosnia and his talent kept it on track for success --which it largely was. Being considered a European concern rather than an American one, he had way more control than over the Afghanistan occupation -- and which was for 20 years. Americans tire pretty quickly of concerns beyond their shores and not in their livingrooms. An indifference took place at all levels.
Another point is that America likes wholeness, completeness and all or nothing. And so in Afghanistan it finished up with nothing (actually much less than). Far from ideal the situation in Afghanistan was still managable and we had lowered the (human and financial) costs considerably. But with a public wanting out, Trump with his surrender to the Taliban in Doha and Biden following his footsteps, our leaders obliged.
Many thanks