Final answer:
Hereditary kings under the Shang dynasty claimed legitimacy through their religious role and purported divine favor. The Zhou dynasty later formalized this into the concept of the Mandate of Heaven, tying legitimacy to moral governance.
Step-by-step explanation:
Under the Shang dynasty, hereditary kings ruled claiming their legitimacy as based on their role as high priests communicating with deities and ancestors, and a theocratic dimension that suggested divine favor. However, this form of legitimacy was later crystallized under the Zhou with the introduction of the Mandate of Heaven, which held that the right to rule was contingent upon the virtue and morality of the ruling house. The Mandate of Heaven established that a dynasty could lose its right to rule if it failed to govern justly and maintain social order, with natural disasters and social upheaval serving as potential indicators of lost divine favor.