My understanding of history ... the British did not colonised HK. Instead it was leased to them after the defeat of Qing Chinese during the Opium War. So HK was never part of British to begin with. Like wise for Macau.
Places like Australia, parts of Africa, South Asia, SEA were occupied by the the Brits or European powers without a fight or without any agreement. The European powers just walk in and declare the place as theirs. They could simply hold on to these territories but they chose to give up as they find it is too expensive to govern them in the long run.
Imagine if the British were to hold on to Uganda
Population : 42 million v 60 million British
GDP per capita : USD1,000
IQ : 70++
The British will be broke maintaining Uganda's well being. The Brits could not simply let Uganda to live in poverty as international image will be affected. Let say you are the Master of the house, can you let your servant starve and without proper clothing and housing?
Unlike HK, the Chinese in HK are productive economically. They are able to sustain with or without the Brits. For the Brits, they tried to hold on to HK. But they have no good reason to hold it. So unwillingly they gave back HK to China.\
A tale of two cities - Uganda (and other parts of the world colonised by the British) v HK. The Brits declared Uganda independence without any pressure while they gave up HK unwillingly. See the difference!
Race and IQ