In the case of Britain, they spent so much on WW I and had barely recovered by WW II. They were literally a fortnight away from having to surrender during WW II. The US played a masterful hand in helping the UK out, and the one of the post-war prices was US pressure to decolonize so the US could expand its sphere of influence.
The fact the Britain was also reduced, financially, for relying on ex-colonies like New Zealand and Australia to send free food and pay down its war debts[1] meant that they didn't have much choice. Less a straight military loss - the British had plenty of experience putting down rebellions as brutally as needed, after all - and more having dropped from a superpower to a US client state.
France was different, since De Gaulle had preserved a great deal more autonomy for France in the post-WW II era (hence a lot of US hostility). But France was a lot weaker as well, even if it wasn't a US client state. They did, however, hang on to more of their colonies, even in the face of persistent opposition in places like New Caledonia.
[1] For sentimental reasons, not particularly well repaid with the manner of the British entry to the EU.
The British and French were shocked (and pissed) when the US sided with Egypt and the Soviets against European colonialism.
The only reason the British didn't suffer a string of horribly embarrassing loses to insurgencies is because the British just gave up after Suez. They would have had their Indochina and Algeria had they tried to keep it all.
Could you give me a source on this?
It is relatively easy to control a country. Send it back to the stone age, keep a limited size, but modern and efficient force close by to protect the administrators of what ensues against the occasional attempt. Cf the French Marines who stopped two coups on Omar Bongo's palace, or the 1,000 troops flown in from Chad to defend French interests in the ROC.
Plus ca change, plus c'est la meme chose...
The world changed. The British and French couldn't control those colonies anymore. Guerrilla insurgencies are very hard to beat.
In order to win you either have to convince the people to support you, which is almost impossible as an outsider. Or you make them fear you worse than the insurgency. That is impossible under international law.
But if the US really wanted Afghanistan to bend to it's will and didn't care about international law? Just carpet bomb villages that don't support you against the Taliban. Relocate tribes to reservations and resettle your supporters.
Why didn't Japan and Germany have insurgencies? They were afraid of what we'd do.