In Iraq and Afghanistan, American and British forces became participants in civil wars which their own presence has exacerbated and prolonged. The US and UK governments persistently ignore the extent to which foreign military occupation has destabilised both countries.
The reason for this should be obvious: foreign occupations have seldom been popular throughout history. The occupier consults his own political, military and economic interests before that of the allied government which he is supposedly supporting. This has de-legitimised the Baghdad and Kabul governments and enabled their opponents to pose as patriotic opposition. In addition, foreign military armies, whatever their declared intentions, enforce their authority by violence, invariably producing friction with the local population.
The very fact that the election in Afghanistan took place at all this week is being lauded as a triumph for democracy conducted under the wise supervision of soldiers from the US, Britain and Nato. But Afghans are more interested in who really holds power and what they do with it.
President Hamid Karzai is not particularly popular, but as the incumbent he is in a strong position, through networks of patronage, to get the support of local and regional king-makers such as warlords, chiefs of police, shuras (local councils), religious, tribal and ethnic leaders. What foreign reporting of elections in both Afghanistan and Iraq miss out is the extent to which ordinary Afghans and Iraqis regard their governments as rackets run by political gangsters for their own ends.
A common reason, which I've heard expressed in both Baghdad and Kabul, for supporting the incumbent leadership is that it will have already stolen so much that its members have no need to steal more, while a new government will be equally rapacious but far hungrier. The only way of judging the extent of such extreme cynicism in Afghanistan is the extent of the turnout, currently estimated to be 40 to 50 per cent.
Will the Afghan election bring the end of the war closer or noticeably strengthen the government in Kabul? Mr Karzai, if he wins, will be able to say that he was chosen as leader in a real election. But otherwise the poll will only reconfirm the power of the men, often labelled warlords, who emerged the surprise winners from a civil war between the Taliban, almost entirely drawn from the Pashtun community (42 per cent of Afghans), and the largely non-Pashtun Northern Alliance.
Just before 9/11, the Northern Alliance forces had been squeezed into a corner of north-east Afghanistan and seemed to be close to final defeat. But within a few months of the US deciding to drive out the Taliban as hosts of al-Qa'ida, the Northern Alliance was able to take over the whole of Afghanistan thanks to US air- power and money. Most Afghans were glad to see the apparent end of the Taliban, whose victories were won with the support of Pakistani military intelligence and Saudi cash.
But opposing the Taliban was never quite the same as supporting the Northern Alliance, whose leaders turned out to be ravenous for the perks of office and power. I spent several months in the Northern Alliance stronghold in the Panjshir Valley north of Kabul in 2001, and, going back to Afghanistan earlier this year, I was astonished to find so many of the warlords I knew then are still monopolising jobs, contracts and money-making positions in Kabul.
It is absurd for foreign governments to lament Mr Karzai's promotion as his running mates of the Tajik warlord Muhammad Fahim and his Hazara equivalent Karim Khalili, both of whom are accused of human rights abuses. Mr Karzai is simply recognising the strength of established, if unsavoury, power brokers in the non-Pashto communities. This may be a very messy and highly corrupt political power structure, but it is one which the US and Britain are fighting to keep in place.
They will find it a long war. Foreign military presence was originally acceptable to Afghans in a way that it never was in Iraq. This was partly because Iraq was occupied outside Kurdistan, but most of Afghanistan was not. But while only 25 per cent of all Afghans say they support attacks on US or Nato/Isaf forces, this figure jumps to 44 per cent where people report shelling or air strikes in their areas, according to an ABC News/BBC/ARD poll. Contrary to Washington's plans, just 18 per cent of Afghans say they want foreign forces in Afghanistan increased and 44 per cent want them decreased. The Taliban, once vilified as Pakistani puppets, are having some success in re-branding themselves as Afghan nationalists.
One of the many depressing aspects of the American and British campaign in Afghanistan is that so few of the lessons of Iraq have been learned. One is that foreign military occupation is unpopular and tends to get more so. Iraq and Afghanistan are both countries with deep ethnic and sectarian divisions and foreign occupiers end up, willy-nilly, on one side or the other in civil strife.
So little has been learned in Iraq because propaganda is being taken as a guide to what happened there and what should be done in Afghanistan. This week there was some mindless debate in the wake of bombs in Baghdad, which killed over 100 people, about whether or not the American military withdrawalfrom the cities might have come too early. In reality, there have been few US patrols in Baghdad since the end of last year, and, even when the Americans were in military control of the city, they could not stop the explosion of vehicles packed with explosives driven by suicide bombers.
The main American success in Iraq was that, having backed the Shia and the Kurds against the Sunni, the US military did a side-deal with the Sunni insurgents to turn on al-Qa'ida. The Sunni needed an agreement with the Americans because they were getting the worse of a civil war with the Shia. The recent bombings were probably Sunni parties, using al-Qa'ida as their messenger, brutally demonstrating to the Iraqi government that they will not be marginalised.
The idea popular in some Washington think tanks that a few obvious tactical innovations won the war in Iraq, and can do so again in Afghanistan, is wholly misleading and will lure the US and Britain further into the morass.