They were warned in a dream not to go back to Herod. So they returned to their own country by a different route.
After the Magi had gone, suddenly an angel of the Lord appeared to Joseph in a dream.
“Get up,” he said, “and take the child, and his mother, and hurry off to Egypt. Stay there until I tell you. Herod is going to hunt for the child, to kill him.”