A few years ago in Kabul, I was listening to a spokesman for an Afghan government organisation who was giving me a long, upbeat and not very convincing account of the achievements of the institution for which he worked. To relieve the tedium, and without much expectation of getting an interesting reply, I asked him – with a guarantee of non-attribution – what benefits the Afghan government had brought to its people. Without hesitation the spokesman replied that these benefits were likely to be very limited "so long as our country is run by gangsters and warlords".

It was at about this time that I decided that the main problem in Afghanistan was not the strength of the Taliban but the weakness of the government. It does not matter how many Nato troops are in the country because they are there in support of a government detested by much of the population. Everywhere I went in the capital there were signs of this, even among prosperous people who might be expected to be natural supporters of the status quo. I interviewed an estate agent who should not have had much to complain about since, in the 10 years after the fall of the Taliban in 2001, Kabul was the world's fastest growing city. He pointed to some workmen outside his office window saying they earned between $5 and $6 a day in a city where to rent a decent house for their families would cost $1,000 a month. He said: "It is impossible for this situation to continue without a revolution."

The year 2014 has long been billed as a decisive year for Afghanistan because most of the remaining foreign troops, 38,000 US and 5,200 British, will pull out before the end of it. Predictions of an exact date for a historic turning point usually turn out to be mistaken, but in this case conventional wisdom may well be correct. Already there are signs of drastic political change, such as the Afghan government's announcement last week of its intention to release 72 hard-core Taliban prisoners, provoking furious protests from Washington. Probably President Hamid Karzai's motive is to conciliate local leaders who want their relatives out of jail and whose support Karzai needs in the presidential election in April, in which he cannot run, having served two terms, although he wants to determine his successor.

Download the new Independent Premium app Sharing the full story, not just the headlines

An important feature of this withdrawal of US and British troops is how little interest it is sparking in their home countries, although 2,806 US and 447 British soldiers have been killed since 2001. The total cost to the US of war, reconstruction and aid over the same period is $641.7bn (£390bn) according to the Centre for Strategic and International Studies in Washington. Of course, money spent on Afghanistan does not mean money spent in Afghanistan, but even taking this into account it is extraordinary that, despite gargantuan sums spent, Afghan government figures reveal that 60 per cent of children are malnourished and only 27 per cent of Afghans have access to safe drinking water. Many survive only through remittances from relatives working abroad or through the drug business, which is worth some 15 per cent of the Afghan gross national product.

The figures above come from a damning study of the outcome of 12 years of international intervention in Afghanistan by Thomas Ruttig of the Afghanistan Analysts Network in Kabul. His succinct, authoritative account of where Afghanistan stands today underscores the fact that US and British military intervention has ended in near total failure. The Taliban has not been crushed, operates in all parts of the country and, in provinces like Helmand, is poised to take over as US and British troops depart. Even with the backing of foreign troops, Afghan government control often ends a couple of kilometres outside the district capital. The extra 30,000 US troops sent as part of the surge in US troop numbers in 2010-11, which brought their total to 101,000 at peak deployment, have had little long-term impact.

The whole Afghan fiasco is too often debated in terms of military tactics, while the most important reasons for US and British failure are political and go back to the immediate aftermath of the overthrow of the Taliban in 2001. Four points need to be made about that seminal era: the Taliban were not popular among any but a small minority of Afghans at that time, but their military defeat was less decisive than it appeared in western media because they had largely withdrawn or dispersed. I followed them on the main road from Kabul to Ghazni and finally to Kandahar and there was little fighting. Under the right political circumstances, they could always re-emerge. Equally important, the 1,500-mile Afghan-Pakistan border remained open so the Taliban had safe havens in which to rest, train and resupply.

That they did re-emerge so swiftly and powerfully after 2006 was the result of a fourth factor, namely the toxic nature of the new regime that emerged in Kabul. It was made up of the same jihadi warlords and commanders whose corruption and violence had provoked the Taliban takeover, backed by Pakistan and Saudi Arabia, in 1996. They dominated parliament, the judiciary and the security services.

"Those who received financial means from the US in 2001 to fight the Taliban often invested in the drugs trade," writes Thomas Ruttig, "and starting from there, gradually took over licit sectors of the economy, such as the import-export business, construction, and the real estate, banking and mining sectors." They gorged themselves on foreign aid, so by 2013 Afghanistan ranked bottom of the 177 countries (equal with Somalia and North Korea) in Transparency International's league table of perception of corruption by businessmen.

The new post-Taliban Afghan elite was characterised by a lethal blend of warlordism and jihadi Islam. A journalist called Mir Hossein Musawi coined the term "holy fascism" to describe the mixture of the two in a newspaper article in Kabul in 2003. He was promptly forced to flee the country accused of insulting Islam.

Elections are now so fraudulent as to rob the winners of legitimacy. The April 2014 election is likely to be worse than anything seen before, with 20.7 million voter cards distributed in a country where half the population of 27 million are under the voting age of 18. Independent election monitoring institutions have been taken over by and are now under the thumb of the government.

Faced with these multiple disasters western leaders simply ignore Afghan reality and take refuge in spin that is not far from deliberate lying. During a visit to Helmand province last December David Cameron claimed that a basic level of security had been established, so British troops could justly claim that their mission had been accomplished.

Nobody in Afghanistan believes this. But the departure of foreign troops does not necessarily mean the triumph of the Taliban who are a Pashtun movement and will have great difficulty establishing themselves in areas dominated by other ethnicities such as the Tajiks, Hazara and Uzbeks. Many Afghans fear a worse fate, and believe that 2014 will see the start of a return to the era of savage and anarchic cruelty in the 1990s, when jihadi war-bands ruled Afghanistan.