The last King of Xia Dynasty was Jie Gui, who was a tyrant. His greatest extravagance was to build a lake filled with wine on which he and his court floated about. The retaining dikes made of dregs were so high that they could be seen ten li away. Three thousand men could drink from the lake, lapping up the wine like so many cattle. His ministers, one after another, cautioned him against such display, but he refused to listen. Worthy ministers who remonstrated with him were put to death or driven from the court. Jie would heed only evil men who brought confusion to the court.
Warned by his minister Yi Yin that the Mandate of Heaven was about to be withdrawn, Jie clapped his hands and laughed uproariously, exclaming:"So you too warn of evil omens! My possession of the empire is like the sun being in the sky. Can the sun be destroyed? When the sun perishes, then I too shall be destroyed!" Yi Yin was driven out of court.
The people of Xia expressed their despair with the rule of Jie with a song:
Oh sun, when will you perish?
You and we shall all perish together.
People wanted to die with their hated king, who believed himself immortal like the sun.
Yi Yin's name was Aheng. After leaving the court of Jie, Yi Yin retired to the fields, where he cultivated the way of of the ancient king Yao and Shun. He wanted to meet Tang, but no opportunity of doing so; He therefore became cook to the prince of Xin, and while bringing Tang dishes to taste urged him to perfect himself in the way of the ancient kings. Some say that when Yi Yin was living in retirement Tang sent five times (or three times in Mencius) to invite him to a meeting before he would obey him, and talk about matters connected with the guileless king and the nine rulers.
Every tyrant has a bad woman behind him. Jie was infatuated with his concubine Mo Xi, on whom he lavished vast sums in an effort to keep her amused. Mo Xi had been given him to stop an invasion he was contemplating. Some contended that she instigated his enormities to avenge her people and that she collaborated with Yi Yin to ruin the Xia dynasty. In any case, it was Mo Xi who reported a dream in which the king Jie had seen two suns fighting in the sky, which dream was believed to be a sign of the end of Xia dynasty.
Shortly afterwards, Tang, having heard of the song of the people and having been awakened by Yi Yin, raised a revolt, and conquered the Xia empire, founded the shang dynasty, and sent Jie Gui into exile.