This is an example to us of modesty and faith, that once we have come to know and adore Christ as King, we may abandon the path we were traveling before, which was the path of error. We may now proceed by the other path, on which Christ is our guide. We may return to our place, paradise, from which Adam was driven out. This place is mentioned in the psalm as one where we will please the Lord in the land of the living. Thus it was that the magi, having been advised to follow another road, frustrated the tyrant's cruel designs in their return. It was in this manner, through the magi, that the boy who was born a king became known, while at the same time the wiles of the tyrant Herod were overcome. It was predicted that our infant Lord and Savior would be triumphant even at the very beginning of his life in the flesh. This was foretold in advance by Isaiah when he said, "For before the child shall have knowledge to cry 'father' and 'mother,' the riches of Damascus and the spoil of Samaria shall be taken away before the king of Assyria." By "riches of Damascus" is meant the gold that the boy, born the Son of God, received as offered to him by the magi. The "spoils of Samaria" represent the worship of idols, the superstitious error of Samaria from which he diverted those same magi. Those who previously were the prey of the devil because of their false religion became the plunder of God through their knowledge of Christ. The "king of the Assyrians" refers to Herod, or in fact to the devil, to whom the magi themselves became enemies, reverencing as they did the Son of God, our Lord and Savior.
Source: TRACTATE ON MATTHEW 5.2