What did the US accomplish from its two-decades-long occupation of Afghanistan?

In the accounting of that period, most of the emphasis has been on the debit side - on the hideous price in blood and treasure.

The US's longest war cost an estimated $2 trillion and cost more than 200,000 lives - 2,448 of them US military, and 18 CIA. More than 20,000 service personnel were injured.

But what, if anything, did the US and the wider western world get in exchange? Lessons to learn, certainly. But have they been learned?

US coalition forces stand guard near a vehicle that was set ablaze by a bomb attack in Kandahar in 2005

There appears to have been little systematic effort to review the US presence in Afghanistan, no substantial Congressional inquiry, few public hearings beyond the issue of the chaotic withdrawal from Kabul.

A congressional commission approved by President Joe Biden has not begun its work because Senate minority leader Mitch McConnell has not named a Republican co-chair.

So one formal accounting falls victim to politics as usual on the Hill.

Not that one detects any great public appetite for raking over the coals. The invasion was strongly backed by the public and their elected representatives. The outrage of 11 September 2001 merited a powerful response.

But now, much of that public feeling has ebbed away. The freshest memories of Afghanistan are of the dreadful scenes at Kabul airport this time last year.

But even in the immediate aftermath of the debacle, opinion polls showed around two-thirds of Americans supported the decision to get the troops out.

Even when confronted with a question that asked if the US should withdraw the troops even it it meant creating an opening for al-Qaeda and other terrorist groups to establish operations in Afghanistan, more people (45%) supported withdrawal than opposed it (40%).

But the mechanics of the withdrawal were an embarrassment. In a CBS poll, 74% said the withdrawal of the troops had been handled badly, and other polls were consistent with this.

So the right policy, but badly managed, was the verdict of the American people. The buck stops with President Biden and the Afghan withdrawal was the point at which the shine came off his halo. His plunge in approval ratings started one year ago and has not recovered.

In 2001, the US Senate voted in favour of invading Afghanistan in pursuit of Al-Qaeda and its leader Osama Bin Laden

A Gallup poll taken during 2-17 August last year showed only 1% of those questioned thought Afghanistan was the top issue for the nation's leaders.

They were much more concerned about Covid-19, government immigration and the economy.

Little wonder then that there has been little effort by the political class to render an account of the Afghanistan years: There are literally no votes in it.

The military and intelligence agencies are supposed to have been preparing formal "after action" reports.

They have masses of information to digest. A proper reckoning could take years to compete. But then who will be interested?

Military professionals, foreign policy wonks, academics, people who served in theatre.

But the general public? They are unlikely to get into the weeds. The bad ending of the campaign, and the lack of clarity over what they were doing there will not encourage deep soul searching by the public. And perhaps they are right.

Perhaps beyond the professional knowledge to be gained there is little for the public to learn.

For unlike Iraq, they knew what they were getting into.

There was no effort by the US government to fool them into backing action that was opaque and not clearly scoped.

The Afghan invasion had a clear objective: To destroy al-Qaeda and keep the US safe from attack by foreign terrorists. Bringing democracy to Afghanistan was never a stated aim of the US invasion.

In October 2001, the Senate voted 98-0 in favour of invading Afghanistan in pursuit of al-Qaeda and its leader Osama bin Laden.

The House voted approval by 420-1. A month after the invasion began 88% of those polled approved of the military intervention.

But they appeared pessimistic too: Only 40% thought the US could drive the Taliban from power and just 28% believed they would capture or kill Bin Laden.

Terrorist experts were warning that the networks were growing in strength and that there would be other attacks, even after Afghanistan was occupied.

Robert Kagan, a foreign policy scholar at the Brookings Institution and a founder of the now defunct Project for the new American century, is credited with being a leading neo-conservative foreign policy think tank.

He was an early and active advocate for military intervention in Afghanistan, Iraq and Syria. He is also one of the few to have offered a justification for the Afghan invasion and a critique of what went wrong.

The US killed al-Qaeda leader Ayman al-Zawahiri in a strike in Afghanistan last week

He says that what the US got for its expenditure of blood and treasure was security - there were no more terrorist attacks by foreign terrorists on US soil.

Eventually, Osama bin Laden was killed by US special forces.

Last week, Bin Laden’s successor, Ayman al-Zawahiri was killed by US intelligence agencies in an incredibly surgical drone-launched missile strike.

Both assassinations indicate that the US will stay the course when it comes to manhunts for those responsible for attacks against the US and Americans. The Zawahiri killing also shows a new technological capability to strike remotely against anywhere on the planet.

The fight has not gone out of the Americans, but the long years of occupation did sap some of the will of this nation to stay in Afghanistan.

That may be explained by what didn't happen; because there were no more terrorist outrages from foreign terrorists in the US, the perception of threat faded from the public consciousness.

In its place seeped the almost daily casualty reports from what come to be seen as a pointless war. What indeed was the point of staying there when the main objectives had been achieved?

Robert Kagan says that what drove the US to invade Afghanistan was not hubris, but fear - fear of another attack on US soil by al-Qaeda based in Afghanistan with the blessing of the Taliban.

Fear of an attack with nuclear, chemical or biological weapons; fear of sleeper cells, and other terrorist groups emboldened by al-Qaeda's "spectacular" in Manhattan.

He cites a Pew opinion poll taken a year after the 11 September attacks, which showed that 60% of Americans worried about a new attack and four in ten expected terrorists to strike with nuclear or biological weapons.

Women worried more than men and as a result, there was an unexpected rise in support for military spending among American women, who came to support it as much as men.

By a margin of 48% to 25%, Americans supported the idea of increasing the US military presence abroad as a way of securing the country.

After the death of Bin Laden, and then the horror story that was Iraq, the public questioned what it was all about.

There was no popular support for "nation building" in Afghanistan – there never had been. The Bush administration wanted to go in quick, take down the Taliban and al-Qaeda, then get out.

But it found itself having to stay for fear that they would return. Stabilising the country became a new objective - but one, Kagan argues, that was only given lukewarm backing in Washington.

The Taliban knew all they had to do was bide their time because the Americans never sent out a strong message that they were in Afghanistan to stay.

After all, it is a myth to suggest that the Americans lack the stomach for the long haul - they are still in Korea 70 years after hostilities ended; they are still in Europe and Japan 77 years after World War II ended. And they are building up their presence in Europe as the Ukraine war continues.

But Afghanistan (and Iraq) were not at the same level of strategic importance as Europe and East Asia (including Taiwan).

Once the threat from Islamic terror groups was beaten down by relentless military action, the public and the government felt no long-term attachment to these countries. The job was essentially over, it was time to go home. The leaving was badly done, but the decision to leave was almost as popular as the decision to invade.

Taliban fighters atop a Humvee vehicle take part in a rally in Kabul last year

Yes, allies were burned - there is a lot of sympathy for Afghans who worked for the Americans, shame about how so many were left behind, and a quiet determination to do something for those who got out (and are still getting out). Traditional military allies were also burned - the British in particular.

But old pros in foreign policy, and the French, know they have to get over it, realising that they have to work together on the next project - Ukraine/Russia, and beyond that, China.

It's a rough trade, but they will get over it. Indeed the Ukraine war has accelerated the healing and re-energised the Western Alliance - Vladimir Putin may have misread the debacle of the withdrawal from Kabul as a sign of US decadence and lack of will to resist.

As for Afghanistan itself, It is arguable the country today is no worse off than it was the day before the US invasion.

Then as now, the Taliban is in charge of a country mired in poverty and internecine strife. The US is still its biggest single aid donor.

The Zawahiri assassination is a reminder to the regime that if it keeps to itself, it will be left alone, but if it helps al-Qaeda rebuild, a rain of missiles awaits the leadership.

That’s the kind of intervention the US can sustain for a very long time, with strong backing from the American population, which demands its leaders protect them first and foremost.

That's why they went to Afghanistan in the first place.