"FOR I SHALL MAKE YOU A GREAT NATION THERE" (Bereishis 46:3).
This teaches that the exile in Egypt was not a random occurrence, or for chastisement. It was the “iron furnace” (Dvarim 4:20, Yirmiah 11:4) where the precious metal would become sufficiently refined to be worthy that “you shall become My peculiar treasure above all the peoples” (Shmos 19:5).
Egypt was especially planned as a preface to Sinai. — The Beginning