The famine in the time of Abraham prevailed only in Canaan, and it had been inflicted upon the land in order to test his faith. He stood this second temptation as he had the first. He murmured not, and he showed no sign of impatience toward God, who had bidden him shortly before to abandon his native land for a land of starvation. The famine compelled him to leave Canaan for a time, and he repaired to Egypt, to become acquainted there with the wisdom of the priests and, if necessary, give them instruction in the truth.
Abraham and the Patriarchs of Canaan
Legends of the Jews 5:95