“These are the generations of the heaven and earth when they were created, in the day that the Lord God made earth and heaven.” (Gen. 2.4)
It may be likened to a king who had empty vessels. The king said, “If I put hot water into them they will crack; if I put icy cold water into them they will contract.” What did the king do? He mixed the hot with the cold and poured the mixture into the vessels, and they endured.
Similarly said the Holy One, blessed be He, “If I create the world only with the attribute of mercy, sins will multiply beyond all bounds; if I create it only with the attribute of justice, how can the world last? Behold, I will create it with both attributes; would that it might endure!”
Genesis Rabbah 12.15, A. Cohen trans.