God said to Moses: ‘Tell Israel what you [all] should be doing, [and say:] You should know that He will smite Egypt,’ as it is stated: “The Lord will pass to smite Egypt, [and He will see the blood on the lintel, and on the two doorposts, and the Lord will pass over the door, and will not allow the destroyer to come to your houses to smite you]” (Exodus 12:23). Rabbi Levi said: What is “the Lord will pass [ve’avar]”?
The Holy One blessed be He said: ‘I will renege [over] on what I said.’ This is analogous to a king whose son went to a barbaric foreign country. The barbarians stood and received him and crowned him king over them. The king heard and said: ‘What honor can I accord to these [people] who exalted my son and crowned him king over them?
I will call the name of that province after my son.’ Sometime later, they reconsidered and cursed the king’s son and enslaved him. The king said: ‘I will renege on the honor that I accorded them; I will go out and wage war against them and rescue my son.’ Similarly, Joseph descended to Egypt and they received him and crowned him king over them, as it is stated: “Joseph was the ruler over the land” (Genesis 42:6).
They honored Jacob, as it is stated: “Egypt wept for him seventy days” (Genesis 50:3). The Holy One blessed be He said: What honor will I accord Egypt? I will call it by the name of the Garden of Eden, as it is stated: “Like the garden of the Lord, like the land of Egypt” (Genesis 13:10). When they changed their minds and enslaved [the Israelites], the Holy One blessed be He said: “I will pass through the land of Egypt” (Exodus 12:12).
I am reneging on that honor and I will render it desolation, as it is stated: “Egypt will become desolation” (Joel 4:19).