“And being warned of God in a dream that they should not return to Herod, they departed into their own country another way.”
King James Version (KJV)
2:10 Seeing the star - Standing over where the child was.
2:11 They presented to him gifts - It was customary to offer some present to any eminent person whom they visited. And so it is, as travellers observe, in the eastern countries to this day. Gold, frankincense, and myrrh - Probably these were the best things their country afforded; and the presents ordinarily made to great persons. This was a most seasonable, providential assistance for a long and expensive journey into Egypt, a country where they were entirely strangers, and were to stay for a considerable time.
Mt 2:12 Being warned of God in a dream. Probably they were suspicious of Herod, for they could not fail to know his character, and asked God to guide them. He did so by a dream, and hence they avoided Jerusalem on their return.