LONDON — After the lives lost and the exhausted treasure, what was it all for?

That question is being asked here and in Kabul as British troops, like their more numerous American counterparts, prepare to relinquish combat duties in Afghanistan next year after a tenure that appears to have achieved few of the goals set by their political masters.

In March 2002, Britain committed 1,700 soldiers to join American forces in what was portrayed as little more than rooting out the remnants of Taliban and Qaeda forces after the American-led invasion six months earlier. The logic was that if the streets of Britain were to be kept safe, then terrorism’s distant havens had to be dismantled. But that brief early deployment did not shield Britain from the more immediate menace of homegrown terrorism. On July 7, 2005, four suicide bombers killed themselves and 52 travelers on the London transit system. None of them had ties to Afghanistan.

By 2009, the official mantra was the same, but the geographic reach had been redefined. Mission creep had raised the number of British soldiers to 9,000. The border areas between Afghanistan and Pakistan, said Gordon Brown, the prime minister then, were “the crucible of global terrorism” threatening “the streets of Britain.”

In late 2013, a new statistic has entered the calculations of loss: 444 British military personnel dead — the single most potent figure fueling the outrage expressed by many in Britain when Hamid Karzai, the president of Afghanistan, told the BBC last week that the entire NATO exercise had been pointless.