Taiwan and Hong Kong are different cases.
China, putting it bluntly, does not have what it needs to invade and hold Taiwan. One reason for this, not generally discussed in media, is that both Japan and Vietnam have told Beijing that a PRC invasion of Taiwan would be seen by them as an act of military aggression against the region. The political cost alone would keep Beijing at bay.
Hong Kong is a different matter. For one thing, the island is not prepared, in any sense, to defend against invasion by PRC forces. Also, technically Hong Kong is already part of China, albeit as an 'autonomous region'. Add to that the immense financial value of Hong Kong's harbor and bourse, which Beijing has long coveted, and finally, but not least, the cultural threat of young Hong Kongese, who are very pro-American and anti-Beijing. The Central Committee has long desired to assert cultural control of Hong Kong, and it looks like they are taking that action now.
That which does not kill me, will try again and get nastier