On one of her last trips to Afghanistan, journalist Christina Lamb visited the 'Jihad Museum' in Herat, a grisly exhibition of captured Russian equipment set up by a former warlord-turned-entrepreneur.

Her attention was taken by a bizarre animated diorama that depicted the 1979 Soviet invasion and its ignominious retreat a decade later. "Afghanistan is a place where it's easy to come," the Russian ambassador later tells her, "but takes long to get out. Disingenuously, he wonders why the Americans and British never sought his advice. It would have been better if they had. In the 13 years following the 2001 intervention, the USA spent more on Afghanistan than it did on the post-war Marshall Plan, and at its height Camp Bastion was technically Britain's third-biggest airport. Given the vast financial and military resources poured into this impoverished country, how on earth did it all go so wrong?

The initial plan was relatively small-scale, the CIA and US special forces bribing local militias to help them hunt down bin Laden in the Tora Bora mountains, but by the beginning of 2002 they were paying off more than 45,000 warlords for information. Either unaware or unconcerned that most of the targets they were given had little to do with terrorism and much to do with the settling of old tribal scores, the US also managed to lose sight of the Taliban, which busily regrouped on the other side of the Pakistan border. As more western troops were drawn in, the problem became one of competing strategies; while the Americans established one force to search for bin Laden under the banner of 'Operation Enduring Freedom', the International Stabilisation Assistance Force (ISAF) tried to control a vast and inhospitable landscape with insufficient troops and a dangerously amorphous mission brief. Britain's disastrous strategy in Helmand is the perfect synecdoche, the Army initially attempting to cover a 20,000 square-mile area with 3,000 troops, of whom only 800 were front-line combat soldiers. Platoons were tethered to isolated blockhouses only to bear the brunt of furious Taliban assaults, and every patrol became a desperate struggle for survival. One officer confesses his horror at the extraordinary levels of violence he has used just to keep his troops alive. Hundreds of civilians were killed in the process, and dozens of young men were pushed into the arms of the insurgents. Lamb personally experiences what it is like to be ambushed after embedding with one British platoon, and her account of the disorientating battle (in which, incredibly, no troops were wounded) is a masterpiece of war reporting.

As the book progresses, Lamb's carefully and almost obliquely presented thesis becomes irrefutable, that the real failure here was political as much as military, and involved Pakistan as much as the USA. Deeply involved in Afghanistan since the Soviet occupation, Pakistan was transparently the source of the Taliban's funding. Paranoid about Indian involvement in Kashmir, keen to inculcate a global Islamic consciousness, and terrified that the USA would force Pakistan to give up its nuclear weapons, their unaccountable Inter-Services Intelligence agency (ISI) trained radical Islamist groups in Pakistani madrassas and sent them over the border to fight western troops. At the diplomatic level, President Musharraf was happy to take billions in aid while tacitly encouraging a virulent anti-Americanism in his people, and western troops found themselves in the extraordinary position of fighting an enemy that was part-funded by their own governments. Despite this, Britain and the USA were compelled to turn a blind eye because the alternative seemed even worse; a nuclear-armed Pakistan without the relatively stabilising force of the army in charge. When bin Laden was finally found, just over the border, Lamb notes that he was in a house built on army-owned land, only a few hundred yards from Pakistan's main military academy.

Couple this diplomatic failure with a constantly reactive military that had been given no clear goal and failed to understand local tribal enmities, and Afghanistan never stood a chance. When soldiers are using £60,000 Rapier missiles to blow up mud huts, something has gone terribly wrong.

A country she has been obsessed with for 27 years, "longer than any relationship or job", Lamb started writing about Afghanistan in the early 1980s. She became friends with a young activist called Hamid Karzai (later the post-Taliban president), and first travelled to neighbouring Pakistan on the invitation of Benazir Bhutto herself.

Clearly she knows more about this part of the world than many of the generals, diplomats, aid workers and adventurers who followed in NATO's train. Moving effortlessly between on-the-ground reportage and an insightful analysis of the wider diplomacy, Lamb paints a vivid portrait of a country she obviously loves, "this land of pomegranates and war". In a sane, measured style, she quietly damns the cult-like optimism of the global aid jamboree and the NGOs paying consultants thousands of dollars a day when the average Afghan wage was $50 a month. The chapter on the murder of female poet Nadia Anjuman, and the treatment of women more generally, is utterly devastating. Trapped between Islamic fundamentalism and the ancient misogynies of the tribal system, the position of women became even more precarious when the cause célèbre of women's rights risked turning them into targets.

With a tenth of its population killed during the Soviet occupation, and then transformed into a playground for the competing geopolitical strategies of America and Pakistan, Afghanistan has suffered terribly in the last 35 years. Both urgent and elegiac, Farewell Kabul is a vital book, a personal memoir of the War on Terror by a brave and committed journalist who has put herself in harm's way again and again to raise Afghanistan's plight with western readers. It is impossible to read it without feeling acutely depressed at the incompetence and human cost of so mismanaged an intervention, something future historians will surely look back on with Talleyrand's words, following Napoleon's execution of the Duke of Enghien, ringing in their ears: "It was worse than a crime; it was a blunder."