As British troops retreat from the fortress of Sangin in south Afghanistan, a sleepy room in Westminster again plays host to the Chilcot inquiry into the Iraq war. The British establishment is strangely dotty. Chilcot is like reviewing Passchendaele during the Battle of Britain, or Boudicca's charioteering after the charge of the Light Brigade. American congressmen tear their generals apart when fighting stupid wars. The British prefer to avoid embarrassment.

Sangin should now, after three years of "hearts and minds", be safe in the hands of Afghan army and police units. It is not, any more than is the rest of Helmand, the province allotted to British troops to pacify in summer 2006. Instead it is a forward operating base under perpetual siege, one that the Americans must abandon to the enemy or defend at battalion strength.

The Helmand fiasco was both predictable and predicted. When I (and others) spoke to the Nato commander, General David Richards, in Kabul in early June 2006, his blithe self-confidence was unnerving. He was about to implement the order of the then defence secretary, John Reid, to send 3,000 British troops south to "establish the preconditions for nation-building". Richards was dismissive of such US operations as Enduring Freedom and Mountain Thrust. They just bombed villages and recruited Taliban. He promised to win hearts and minds by "creating Malayan inkspots".

His listeners were incredulous. Had he heard or read nothing of the Pashtun Taliban, of their reputation as insurgents and their obsession with fighting anyone and everyone? We were airily waved aside as whingeing no-hopers. Britain would triumph because "the Afghans basically hate the Taliban". This was the time of Reid's notorious "not a shot fired" remark. It led to a woeful lack of troops, armoured cars and helicopters, and an appalling attrition rate of one in four soldiers killed or wounded.

Helmand has been a classic of generals telling politicians what they want to hear – as before Iraq that function was performed by spies. In three and a half years, 312 British soldiers have died as their exposed patrols offered nothing but target practice for the Taliban. Sangin, Musa Qala and Marjah are blazoned across Britain's front pages, not as victories but as intractable hell-holes. The once-booming settlement of Sangin has reportedly been reduced to a squalid drugs entrepot and ghost town, like a battlefield which each side must keep recapturing to save face. The Americans now seem intent on restaging the battle of Dien Bien Phu.

There is simply no good news out of Afghanistan. Iraq was always easy in comparison. It would eventually exhaust itself and consent to some form of brutal authority, allowing the west to "declare victory and retreat". Afghanistan is quite different. Its innate xenophobia should, in 2001, have been exploited to drive a wedge between the Taliban and al-Qaida. Instead, invasion and occupation have thrown them together, while the nation-building ambition of liberal interventionism has gone potty.

Everyone involved in this wretched war knows it has failed, yet leaders must tell us the contrary. In London last month the hero of the hour, General David Petraeus, declared "progress is being made", that "Marjah is in reasonably good shape" and that Afghanistan was "enjoying a rising tide of security".

David Cameron and his defence secretary, Liam Fox, dare not tell the truth while their troops are in the battlefield. They talk of leaving "when the Afghan forces can defend themselves", which is moonshine, or "when the streets of London are safe", which is never. Yet he also talks about withdrawing by 2015. Whitehall showers the Afghan regime with aid, knowing that most is stolen within days. It is in the grip of Orwell's crimestop, or protective stupidity. The foreign secretary, William Hague, forgets the warning of Chatham, father of his hero, Pitt, against a nation betraying itself "by its own credulity, through the means of false hope, false pride and promised advantages of the most romantic and improbable nature".

What is intriguing is no longer the catastrophe itself but rather how it came to pass. How did two democracies, operating in a climate of open debate, find themselves trapped in a decade of bloodshed, extravagance and mendacity? How did they accept the deaths of hundreds of their young men and thousands of non-combatant foreigners in a cause they could articulate only in irrelevant cliches about democracy, security and female emancipation?

A stab at an answer comes in a book by Garry Wills, Bomb Power: The Modern Presidency and the National Security State. It was the advent of nuclear terror, according to Wills, that allowed democracies to grant their leaders extraordinary power to "push buttons", in effect to declare "one-man wars" without the customary deliberation. Given that power, presidents (and prime ministers) inevitably abused it. Nixon could assert during Watergate that a crime, "when the president does it, is not a crime". Dick Cheney and George Bush could bring kidnap, detention, assassination and torture within the discretion of "commander in chief". If domestic politics required it, the president would find and wage a war. Cheney made eight trips to the CIA's headquarters to demand it prove a link between Iraq and 9/11. When evidence of Iraq WMD was not forthcoming, Cheney – like Tony Blair – simply asserted it: "There is no doubt that Saddam Hussein now has weapons of mass destruction."

We no longer need Chilcot to tell us that there was no shred of intellectual honesty in the claim that Iraq posed a military threat to the west. Yet the period is fast acquiring similarities with Weimar Germany. People knew what was happening but dared not say. The normal ramparts of democracy – courts, habeas corpus, civil liberty, freedom of speech, fearless intelligence – fell down before "national security" as defined by a political cabal. Politics ceased to be the lubricant of democracy and became the source of its poison.

The question now is how soon politics can supply its own antidote – or have these wars drifted so far from the cognisance of ordinary people as to form a self-sustaining estate of the realm? The first glimmer of an exit strategy is emerging from Washington and London. Both Barack Obama and David Cameron are talking not of victory but of money and withdrawal dates. There are desperate cries of "talk to the Taliban", when such cries are manifestly self-defeating. Why should the Taliban talk when we are about to run?

An eventual deal between the Pakistanis, the Taliban and the ever-scheming Hamid Karzai is the only talk that matters. There comes a point in any conflict, as in Bosnia and in Iraq, where sheer exhaustion on the ground draws the feuding participants to some accommodation. In Afghanistan, continued occupation and killing merely delays this moment.

Nato's generals will eventually retreat to Kabul. There they will build a Baghdad-style "green zone" of fortifications and blast walls. The city will become a western client statelet of stunning venality, floating on an ocean of corruption-fuelling dollars. It will last as long as liberal interventionists care to enjoy a lethal cocktail of incoming mortars and outgoing pie in the sky. When it is over, and another war begins, we shall have a new Chilcot inquiry.