In the Bible — in the Old Testament, anyway — Egypt is often a threat. But it also figures more than once as a place of sanctuary. On this topic, see S. Kent Brown, “Biblical Egypt: Land of Refuge, Land of Bondage” Ensign (September 1980).
Matthew 2:16 cites as prophecy a statement taken from Hosea 11:1: “Out of Egypt have I called my son.” In its original context, it clearly refers to the exodus from Egypt of the people of Israel as a whole. This offers an interesting perspective on Matthew’s overall approach; plainly, he sees the history of Israel as somehow foreshadowing the life of Christ. Or, to put it another way, he regards Jesus as, in some sense, recapitulating the story of the Hebrews. At least in part.
The first, of course, is Herod the Great — who was, as everybody should realize, only “great” in terms of his ambition and his vast building activity, certainly not in terms of his character or his success as a family man. He dies in Matthew 2:19.
The second is Herod Archaelaus (23 BC-ca. 18 AD), who is mentioned in Matthew 2:22. Joseph’s reluctance to go back from Egypt to living under his rule is entirely understandable: He was legendarily cruel. He ruled as the ethnarch of Samaria, Judea, and Idumea (the biblical Edom), including the cities of Caesarea and Jaffa, for roughly nine years (ca. 4 BC to 6 AD). This was roughly one half of the territory ruled by his father. However, Herod Archelaus’s gross brutality, coupled with egregious and offensive violations of the Law of Moses, caused his Jewish subjects to lodge a formal complaint with the Roman Emperor Augustus. Accordingly, Archelaus was deposed in 6 AD and banished to Vienne, in Gaul. At that point, the province of Judaea was formed and placed under direct Roman rule.
The prophecy to which Matthew 2:23 alludes (“He shall be called a Nazarene”) does not appear in the Old Testament. Was Matthew aware of a text that is now lost to us, but which he took to be genuine scripture? If so, this passage represents a potentially interesting challenge to people who insist on the completeness and sole-sufficiency of the Bible as we currently have it.
Luke 2:40 (“The child grew and became strong, filled with wisdom; and the favor of God was upon him”) is a powerful reminder of the humanity of Jesus, which should not be forgotten in the overpowering light of his divinity.