Why was the Holy Family instructed to flee to Egypt? At Matthew 2:13-14 (NRSVCE)we read about the flight of the Holy Family to Egypt:

" Now after they had left, an angel of the Lord appeared to Joseph in a dream and said, “Get up, take the child and his mother, and flee to Egypt, and remain there until I tell you; for Herod is about to search for the child, to destroy him.”   Then Joseph got up, took the child and his mother by night, and went to Egypt"

My question is: what were the advantages that Egypt offered as a shelter for the Jewish family in the post-exodus scenario in which the then generation of Egyptians  would have only  hatred for the Israelites  in their genes ?  What are the views of the Catholic Church on the divine selection of Egypt  as the shelter for the Holy Family ?
There are many Reasons I suppose that the Holy Family went to Egypt, The main being the simple fact that they knew who Jesus was and that an Angel of God directed them to do so.  We can only speculate to the reasons, but here is a fun one. 

Jesus was the Fulfillment of Old Testament Promises and the Archetype of Jesus that Moses represents.  Here are a few of those Typological simularities.


Both were hunted by a King/Pharaoh
Both were hidden from that King/Pharoah
Both went to Egypt to save their lives.
Both saved and helped by a woman.


It's quite a long list here is a good link that shows them all: Typology of Moses and Jesus.

There are about  20 examples of how Jesus is the New Moses listed on this site.

Typology is rampant in Scripture, it reveals the Old Testament fulfilled in the New Testament, typology of Mary, the Eucharist, Sacraments, Tribes and Apostles, the information is almost boundless.  

Like in his Church, God has a reason for everything he does.