John Hay and John Nicolay served together as personal secretaries to President Abraham Lincoln during America’s bloodiest war. They learned a lot from this intimate tutelage in wartime leadership, and years later, they summed up those lessons in a multivolume history of the Lincoln administration. Of supreme importance, they wrote, was this: “Every war is begun, dominated, and ended by political considerations; without a nation, without a Government, without money or credit, without popular enthusiasm which furnishes volunteers, or public support which endures conscription, there could be no army and no war.“

The lesson remains true today. America’s war in Afghanistan ended because the public grew tired of it and political leaders turned against it. Donald Trump was elected president in 2016 while promising to end it. Eight years earlier, Barack Obama was elected president while promising to end it. President Biden was elected last year while promising finally to finish the job. The American people have wanted out for more than a decade.

Moreover, the Afghan people did not support the war either, not in sufficient numbers to keep it going. They did not furnish enough soldiers willing to fight it. They did not raise up leaders willing to sacrifice personal interests for a public cause. You could fit all the genuine supporters of deposed Afghan president Ashraf Ghani into his getaway car and still have room for the piles of cash the Russians say he took with him as he fled. By contrast, the Taliban earned plenty of enthusiasm, with supporters apparently willing to fight on forever.

That is the why of the present debacle.

The how of it — how on earth did the United States manage to re-create the nightmares of Saigon and Mogadishu? — boils down to a different lesson, one we can’t seem to get through our heads. Insurgents have the advantage in modern civil wars. No matter how well-trained, well-equipped and well-disciplined U.S. forces may be, they are underdogs in the long term against a supported insurgency.

It is counterintuitive that the world’s most powerful military should be at a disadvantage against Vietnamese peasants or Taliban fighters in pickup trucks. And because it makes no intuitive sense, we repeatedly fail to shape our plans accordingly. We underestimate the difficulty of bringing order to societies where order has broken down — or where it never really existed. And we overestimate the durability of whatever order we manage to provide.

That’s the Afghanistan war in a teacup. Twenty years ago, U.S. leaders failed to plan for the difficulty of bringing order to the country. They’ve failed again today by overestimating our gains. They measured the stability of the Afghan government in months when they should have counted in hours. They did not think like underdogs. Underdogs plan for worst cases.

The United States has been fighting insurgencies around the globe since the end of World War II, and we have more draws and losses than outright wins. Yet we still go larking lightly into these wars and lollygag as we leave them. If Biden had taken the Taliban more seriously, he would not own such a shameful outcome.

But it’s not just the administration that misreads the balance of power in insurgencies. Critics of the U.S. withdrawal from Afghanistan make the same mistake. They argue that a small American force could have kept the Taliban at bay indefinitely. The feckless Ghani could have been propped up at minimal cost in American blood and treasure. A few U.S. troops, plus air power, could have infused the whole demoralized Afghan army with fighting spirit.

In actuality, the Taliban has been skillfully and patiently playing its upper hand for years. By the end of the last fighting season, its forces controlled the Afghan countryside and, as a result, the highway network. Insurgents were strategically positioned to strangle the cities one by one when springtime came. And that’s exactly what they’ve done.

Further fighting was no longer a question of maintaining a status quo. The status quo was a Taliban advantage. To undo that success, to return even to a stalemate — much less to achieve the wins that eluded us — would have required a new U.S. infusion: new troops, new money, new strategy, new timetable.

A fresh new war, in other words, for which there was no political support.

Events in Afghanistan — and the outrages that most likely lie ahead under repressive Taliban rule — should make every American want to throw up. Men and women in uniform must take wars seriously; they have a right to expect as much from their civilian leaders. Instead: endless hubris, this underestimation of difficulties, this carelessness about the most urgent matters. Biden is as guilty of miscalculation as any who have gone before. He wasn’t thinking like an underdog.