The people of Hong Kong are in an uproar over attempts by the Beijing government to exert more control over the former British Crown Colony. Let's review the history.
Operating from a position of power, the British Empire received ownership of Hong Kong Island out of the Treaty of Nanking in 1842 and in 1898 leased the New Territories from a weakened China for a period of 99 years. In 1997, at the end of that lease, the Brits gave both back to the current government, the PRC.
During its rule, the Brits treated Hong Kong's residents as colonial (i.e., second-class) citizens, which was substantially better treatment than that received by their relatives in China. Over time this differential caused a number of persons to move to HK, legally and otherwise.
After the Communists took over in 1947, doing so was "defecting," going over to the "capitalist running-dogs." If anything, after 1947 more mainlanders tried to enter HK, and a fair number succeeded, leaving HK one of the most densely populated places on earth.
Coming out of World War II a once hegemonic British Empire was basically a shriveled remnant of its former glory, fading fast. No secret was made of the fact that, in 50 years when 1997 rolled around, HK was going under PRC rule.
Those mostly wealthy HK residents who could do so fled, many to Canada. Most non-Westerners were unable to get out.
After 1997 they became citizens of the PRC, albeit with a few additional 'rights' which were part of the fig leaf offered the Brits to ease their departure. The current unrest is the result of Beijing trying to claw back some of those rights. Understandably the locals don't like losing protections they've had for over five decades.
The world agrees HK is part of China. Unlike Taiwan, which much of the world sees similarly, HK has no military to defend itself against China and no implicit treaty with the U.S. to protect it.
Currently HK residents have more rights than citizens located elsewhere in China. It is easy to understand their favored status might be unpopular with non-HK Chinese who have every right to be jealous and resentful.
Beijing, like all governments, needs to keep most of its people on its side. Treating all Chinese equally is likely to be popular with non-HK residents, the bulk of China's population. Furthermore it is hard for outsiders to argue HK should continue to receive rights not extended to all Chinese and extremely unlikely Beijing will extend HK-style rights to all its citizens.
That is a brief history of how the current situation evolved. There is justice on both sides, and understandable rancor too. This won't end well for the people of HK, I fear.