Matthew 2:13-15, 19-23
13 Now when they had departed, behold, an angel of the Lord appeared to Joseph in a dream and said, "Rise, take the child and his mother, and flee to Egypt, and remain there till I tell you; for Herod is about to search for the child, to destroy him." 14 And he rose and took the child and his mother by night, and departed to Egypt, 15 and remained there until the death of Herod. This was to fulfil what the Lord had spoken by the prophet, "Out of Egypt have I called my son." 19 But when Herod died, behold, an angel of the Lord appeared in a dream to Joseph in Egypt, saying, 20 "Rise, take the child and his mother, and go to the land of Israel, for those who sought the child's life are dead." 21 And he rose and took the child and his mother, and went to the land of Israel. 22 But when he heard that Archelaus reigned over Judea in Place of his father Herod, he was afraid to go there, and being warned in a dream he withdrew to the district of Galilee. 23 And he went and dwelt in a city called Nazareth, that what was spoken by the prophets might be fulfilled, "He shall be called a Nazarene."
Daily Quote from the early church fathers:
The holy family flees to Egypt, by John Chrysostom, 547-407 A.D.
"But why was the Christ child sent into Egypt? The text makes this clear: he was to fulfill what the Lord had spoken by the prophet, 'Out of Egypt have I called my son' (Hosea 11:1). From that point onward we see that the hope of salvation would be proclaimed to the whole world. Babylon and Egypt represent the whole world. Even when they were engulfed in ungodliness, God signified that he intended to correct and amend both Babylon and Egypt. God wanted humanity to expect his bounteous gifts the world over. So he called from Babylon the wise men and sent to Egypt the holy family.
"Besides what I have said, there is another lesson also to be learned, which tends powerfully toward true self-constraint in us. We are warned from the beginning to look out for temptations and plots. And we see this even when he came in swaddling clothes. Thus you see even at his birth a tyrant raging, a flight ensuing and a departure beyond the border. For it was because of no crime that his family was exiled into the land of Egypt.
"Similarly, you yourself need not be troubled if you are suffering countless dangers. Do not expect to be celebrated or crowned promptly for your troubles. Instead you may keep in mind the long-suffering example of the mother of the Child, bearing all things nobly, knowing that such a fugitive life is consistent with the ordering of spiritual things. You are sharing the kind of labor Mary herself shared. So did the magi. They both were willing to retire secretly in the humiliating role of fugitive." (excerpt from THE GOSPEL OF MATTHEW, HOMILY 8.2)