The United States' ignominious exit from Afghanistan in 2021 topped two decades of failure and devastation wrought by the war on terror.