Throughout the Old Testament, “Egypt” is used as a metaphor for slavery. The Israelites spent 430 years in Egypt, much or most of which was spent under the Egyptians’ thumb. The kind behavior shown to Joseph and his family was not continued by the Pharaoh “who did not know Joseph” (Exodus 1:8). Life soon became intolerable for the nation, even to the point of being forced to kill their own male children. But God was watching over His people the entire time, even and especially during the worst days. And when the time was right, God intervened. Pharaoh was humiliated, Egypt was crushed and looted, and Israel emerged on the other side of the Red Sea as a nation to be seriously regarded and respected.
But the story was not yet over.