The core answer the sources give is that Avraham's descent to Egypt was not incidental but a deliberate sign for his children: the Ramban (Bereishit 12:10) states explicitly that Hashem hinted to Avraham that his descendants would likewise go down to Egypt because of famine, be mistreated there and have their women taken, and that Hashem would avenge them with great plagues before taking them out with wealth — precisely what happened to Avraham himself.
The Ramban (Bereishit 12:6) frames this as a general principle, that whatever happened to the Avot is a sign for their children, so the Torah elaborates on their journeys and incidents because they come to teach about the future; Egypt specifically was chosen because it is the place where that future exile would occur.
Bereshit Rabbah 40:6 develops the same parallel line by line: just as it is written of Avraham that there was a famine in the land and he went down to Egypt to sojourn there, so too of his descendants it is written that the famine was severe in the land, and they too went down to Egypt — Avraham was sent to pave the way before his children.
Bereishit 26:2-3 shows that when a similar famine struck Yitzchak, Hashem explicitly told him not to go down to Egypt but to remain in the land promised to him, which sharpens the question of why Avraham, uniquely, was directed there; Midrash Tanchuma Buber, Toldot 6:1 answers this directly, explaining that Avraham, who came from outside the land, was permitted to go down to Egypt, but Yitzchak, who was born in Eretz Yisrael and is compared to a pure elevation-offering, was forbidden to leave it.
Rashi (Bereishit 12:10) gives a different but complementary reason for the famine itself, that it struck specifically that land in order to test Avraham, to see whether he would question Hashem's command to go to Canaan now that he was being driven to leave it; Bereshit Rabbah 40:2 likewise frames the famine as a trial that Avraham accepted without protest, going down to Egypt to sojourn there rather than challenging Hashem's promise of blessing.
Beyond the sign-for-the-future idea, some later commentators give more practical reasons Avraham specifically chose Egypt. the Malbim (Bereishit 26:1) cites the Rashba's view that one leaves a famine-stricken city for another place either because the astrological decree is local to that place, or because the decree itself required the person to be exiled and is nullified by leaving; on this logic Yitzchak, facing famine in Pelishtim's land as well, intended to go to Egypt as his father had done. Haamek Davar (Bereishit 26:1) similarly describes Yitzchak contemplating going down to Egypt, following the same pattern established by Avraham.
Chatam Sofer on Torah, Lech Lecha 14 addresses the practical permissibility of leaving Eretz Yisrael in such a famine, ruling that one may go to chutz la'aretz when prices have doubled, and that even the concern that the Egyptians might sin regarding Sarah does not override the overriding consideration of saving life.
Valle on Bereishis 12:8 reads Avraham's descent to Egypt because of the severe famine, and his emerging from it wealthy, as itself the sign that Israel's later exile to Egypt would likewise end with them leaving laden with possessions, reinforcing that Egypt was chosen as the template for the later exile rather than as an arbitrary refuge.
Valle on Bereishis 47:5 gives a kabbalistic account of why Egypt specifically was the destination for the later family, explaining that the famine resulted from forces of kelipah in Canaan blocking the necessary divine influences, so the family went to Egypt, where Yosef was, to draw down those influences — suggesting a spiritual necessity tied to Egypt itself rather than to Canaan alone.