What could be a better way of ensuring you were the right person to rule than to have Heaven decree it! This is basically what the Mandate of Heaven was, begun in the Shang dynasty but continued over generations.
The Shang king who instituted it only had his own power in mind but it worked against him, for the rule that gods decide needed morally worthy behaviour to underpin it. Shang kings became immoral with excessive drinking, an overbearing cruel approach and a lapse into luxurious life-styles.
With those in power needing to be moral in order to be chosen by the Mandate of Heaven, the country was more likely to be well run and with a populous who believed in the righteousness of the king to rule, they were more likely to cooperate.
The mandate of heaven was a political and religious doctrine used in ancient China to justify the reign of a king, it was successful because each dynasty was bound by the mandate of heaven doctrine and that was how the Zhou claimed that their rule was justified by the mandate because the Shang kings had become immoral with excessive drinking, luxuriant living and cruelty, and therefore they lost their mandate.
The mandate of heaven was successful because it was the basis on which the rulers were expected to follow; rulers that didn’t keep to it were overthrown – just like the Shang. In order to keep the mandate, rulers were expected to be good and just.