Garvan Walshe is a former national and international security policy adviser to the Conservative Party.

“Anyone who is not a socialist at twenty has no heart. Anyone who is still a socialist at forty has no mind” goes the famous line bet attributed to Aristide Briand, the French Foreign Minister famous for the naive Kellog-Briand Pact , which outlawed war as an instrument of policy in 1928.

Socialism, like the act, could not survive the enounter with human nature. My own youthful optimism that, after 9/11, that it would be possible through foreign interevention to build stable and peaceable political institutions in Afghanistan, has turned out to be equally wrong.

Twenty years later the United States is withdrawing its forces, and the Taliban are making considerable ground. Members of the Afghan security forces are being murdered with extra brutality, pour encourager les autres. Girls’ schools are being shut down. Iran and Russia are weighing up a return to the quagmire.

Three expanations are commonly given for this failure, and the ways in which they fall short provide a clue about the real source of the mistake.

he first is that Afghans are somehow not cut out for stable politics (let alone democratic government). Yet they have voted in their millions, served the country’s new institutions, and 45,000 have given their lives fighting for its survival.

The second is that building stable institutions abroad, through missions that involve military force, is impossible. This was clearly untrue in Western Europe, Asia and Greece after World War II. Perhaps more relevant are the examples of Bosnia and Kosovo (though neither has had to deal with the length of civil war that Afghanistan had suffered even by 2001 (and Central America).

The third has to do with the quality of the Afghan government – as dismissed, for example, by American international relations academics. Yet Afghanistan’s current president, Ashraf Ghani, is no incompetent in the style of South Vietnam’s Ngo Dinh Diem. He has thought deeply about state building, and written, with Clare Lockhart, on how to go about it.

Yet these criticisms, which at at best scratch the surface, and at worst descend into racist dismissals of the Afghanistan and its people, contain a clue to the most serious mistake we have made – which was to misunderstand the advice of Gerald Templer, a British counterinsurgency veteran.

Templer is famous for exhorting state-builders to win over the hearts and minds of the people, but his meaning has been forgotten. He emphasised a distinction between hearts (the appeal to loyalty and values), and minds, by which he meant rational self-interest.

The successful construction of state authority is first a matter of transforming a country’s power structures so that the state’s institutions are able to coerce their enemies into obeying it, and then the development of a political culture inimical to the emergence of new generations of internal foes. Its relation to successful governance is, sadly, less direct than we would wish. Good governance helps to win both hearts and minds, but it follows from state authority, and is difficult to achieve without it.

It is wiser to think of a political culture as a tree that needs decades to grow than as a set of measures that can simply be implemented in a society. Until it grows strong enough to stand on its own, it needs to be supported by raw power. This boils down the sustained coercion of enemies and incentives for people to become its friends and overcome the extremely strong motivation (read: bribes and threats to kill) to oppose them.

The crucial word here is sustained. As much as a foreign power may want to protect its allies and deter its enemies, it has to be willing to do so, reliably, for a long time.

Alhough the West has been in Afghanistan for two decades, it has proved unable to carry out a state building plan. Separating the reconstruction of Afghanistan from the mission to destroy Al Qaeda and capture Osama bin Laden meant that the anti-terrorist mission, always the more immediate priority, interfered with rebuilding.

By invading Iraq, the US then took on too much, severely weakened its moral and practical standing, and fundamentally damaged its relationship with Pakistan. Obama’s precipitate withdrawal from Iraq, and Donald Trump’s abandoning of American allies in Syria reinforced the temporary nature of the American commitment.

The Taliban, by contrast, need only remind Afghans that “America may be strong, and rich, but Americans come and go. We’ll be here for ever” to win over their minds, even as their destruction of Afghanistan’s cultural heritage, hostility to girls’ education, and bloodthirsty violence repels their hearts.

Biden’s withdrawal, like Nixon’s from Vietnam, may not turn out to be the security disaster that many of us fear. Even if the Afghan government falls, our intelligence services are far more focused on Islamist terrorism than they used to be. It may be possible to reach an understanding with the Taliban whereby they will be left alone to brutalise their subjects, provided that they don’t shelter groups threatening Western security. Yet even if, as the Americans did with the South Vietnamese, or indeed we did with the Ugandan Asians, we make it feasible for the people we have abandoned to Taliban revenge to begin new lives here in exile, it will have been a moral disaster.