The Shu Jing is pretty specific about what caused the Xia kings to lose the Mandate, by the way, explaining, the attack on Xia may be traced to the orgies in Ming Tao. Sadly, the Shu Jing is woefully short on details of these orgies, but orgies are the kind of behavior that is not expected of a ruler, and therefore, heaven saw fit to come in, remove the Mandate, and allow the Shang to take power. But then the Shang lost the Mandate. Why? Well, the last Shang emperor is reported to have roasted and eaten his opponents, which, you know, bit of a deal breaker, as far as the Mandate of Heaven is concerned. Of course, that might not actually have happened, but it would explain why heaven would allow the Zhou to come to power. So basically, the fact that one dynasty falls and is replaced by another in a cycle that lasts for 3,000 years is explained in the eyes of early Chinese historians by divine intervention based on whether the ruler behaves in a proper, upright manner.