“And was there until the death of Herod: that it might be fulfilled which was spoken of the Lord by the prophet, saying, Out of Egypt have I called my son.”
And remained there until the death of Herod. This was to fulfill what the Lord had spoken by the prophet, Out of Egypt I called my son. The citation of Hosea 11:1 — originally a statement about the Exodus, about Israel as God's firstborn son called out of Egypt — is here applied to Jesus. Matthew is doing more than proof-texting; he is identifying Jesus as the true Israel, the one in whom all of Israel's story is recapitulated and fulfilled. As Israel went into Egypt (Genesis 46) and came out through the Exodus (Exodus 12–14), so Jesus goes into Egypt as an infant and comes out after the threat is removed. The son called out of Egypt is simultaneously the son of God and the son of Israel — the representative in whom the entire nation's story finds its intended meaning.
Church Fathers on Matthew 2:15
Here Matthew omits the day of purification when the first-born must be presented in the Temple with the lamb, or a pair of turtle doves, or pigeons. Their fear of Herod did not make them bold to transgress the Law, that they should not present the Child in the temple. As soon then as the rumour concerning the Child begins to be spread abroad, the Angel is sent to bid Joseph carry Him into Egypt.
by this that the Angel appears always to Joseph in sleep, is mystically signified that they who rest from mundane cares and secular pursuits, deserve angelic visitations.
The first time when he would teach Joseph that she was lawfully espoused, the Angel called the Virgin his espoused 'wife;' but after the birth she is only spoken of as the Mother of Jesus. As wedlock was rightfully imputed to her in her virginity, so virginity is esteemed venerable in her as the mother of Jesus.