After a dramatic episode involving God plaguing Pharaoh’s house on account of Abram’s wife, Sarai, Abram and Sarai were basically kicked out of the land of Egypt.
Prior to this taking place, God had called Abram from his own country and promised to give him descendants who would inherit the land of Canaan. Once there, Abram pitched his tent between Bethel and Ai, built an altar to the Lord, and called on His name (Gen 12:8). But when a severe famine hit the land, in a moment of weakness, Abram left God’s promises behind and went down to Egypt. If God had not intervened by sending plagues upon Pharaoh’s house, Abram would have lost his wife Sarai and the hope of having descendants through her—for he had lied about Sarai being his sister.