During the lifetime of Jacob, diminishing rain forced the Israelites to leave the land of Canaan. The drought meant that there was no water to irrigate crops. Without crops, there was insufficient food to feed the growing nation.
The Israelites immigrated to Egypt where they were welcomed with open arms. For many generations they remained in Egypt and thrived alongside the Egyptians in peace. During this period of time, the Israelite nation continued to grow in size and strength.
Eventually the Egyptians began to worry about the growing strength of the Israelites. Perceiving them as a threat, the Egyptians forced them into slavery. They would remain as slaves in Egypt for the next 400 years.
The best way to destroy your enemy is to make him your friend.