The two great threats to the authorities were always the same: the nomadic peoples to the north (who they systematically bribed, but who nonetheless periodically swept over and conquered sections of China) and popular unrest and rebellion.
The latter was almost constant, and on a scale unknown anywhere else in human history. There were decades in Chinese history when the rate of recorded peasant uprisings was roughly 1.8 per hour.
What’s more, such uprisings were frequently successful. Most of the most famous Chinese dynasties that were not the product of barbarian invasion (the Yuan or Qing) were originally peasant insurrections (the Han, Tang, Song, and Ming).
In no other part of the world do we see anything like this.
As a result, Chinese statecraft ultimately came down to funneling enough resources to the cities to feed the urban population and keep the nomads at bay, without causing a notoriously contumacious rural population to rise up in arms.