The Zhou conquest of Shang needed justifying, because the Shang kings had claimed a unique relationship with the high god Di and with their own ancestors, and a rebel house had to explain by what right it displaced them. The answer worked out in the early Zhou documents is the mandate of Heaven. Heaven confers the right to rule on a house that governs with virtue and care for the people, and withdraws it when the house becomes cruel and negligent; the mandate is therefore conditional and transferable, and the Shang lost it by their own conduct.
King Wen is the figure the doctrine is built around. The Book of Documents and the Book of Songs present him as the ruler who received the mandate and accumulated the moral standing on which his son King Wu acted, so that the conquest is the completion of something Wen began without arms. His posthumous name is itself the argument: wen means cultured or civil, as against the wu, martial, of his son, and the pair names two halves of legitimate rule.
The consequences for Chinese religion and politics are hard to overstate. The mandate made the ruler answerable to a standard outside himself, gave rebellion a theory, and gave every later dynasty both its claim and its vulnerability, since natural disaster and popular suffering could be read as signs that Heaven was withdrawing. Confucian tradition took King Wen and the Duke of Zhou as its exemplars of government by moral force, and Confucius is recorded in the Analects as saying, when threatened, that if Heaven had not meant the culture of King Wen to perish, the men of that place could not harm him.