Please, see in http://www.newadvent.org/cathen/15464b.htm (The flight to Egypt):
"Soon after the departure of the wise men Joseph received the message from the angel of the Lord to fly into Egypt with the Child and His mother on account of the evil designs of Herod; the holy man's ready obedience is briefly described by the Evangelist in the words: "who arose, and took the child and his mother by night, and retired into Egypt" (Matthew 2:14). Persecuted Jews had ever sought a refuge in Egypt (cf. 1 Kings 11:40; 2 Kings 25:26); about the time of Christ Jewish colonists were especially numerous in the land of the Nile [61]; according to Philo [62] they numbered at least a million. In Leontopolis, in the district of Heliopolis, the Jews had a temple (160 B.C.-A.D. 73) which rivalled in splendour the temple in Jerusalem. [63] The Holy Family might therefore expect to find in Egypt a certain amount of help and protection."