Armies can be used against both foreigners abroad and citizens at home, but the two roles require quite different equipment and tactics. The same applies to their commanders: you need a different kind of general if you think that the primary task of their troops will be controlling dissent at home.
With that in mind, what has been happening in China is quite interesting. Slowly at first, but now in a rush, the senior command of the People’s Liberation Army (PLA) has been purged of its highest-ranking generals.
It’s not like Stalin’s great purge of Soviet generals in 1937-38, just before the Second World War, when at least 780 generals were shot. The Chinese generals are not being executed, although many are ending up in jail. Nobody outside the intelligence services knows what is happening to lower-ranking generals, but at the highest level, it is almost a clean sweep.