Hong Kong does not pay taxes to mainland China, and it’s GDP isn’t included in China’s GDP calculation.
What I find interesting is that Macau is in the same position as Hong Kong, former colony, 1 country 2 systems, but it’s GDP per capita is double that of HK, and there have been no protests in Macau.
Macau has been a lot more strict with mainland Chinese residents. It’s not easy to funnel money into Macau and mainland residents are treated like foreigners. This has led to Macau not being a thorn in China’s side in anyway, as it is not a political or economic haven for mainlanders.