Except for obscure allusions in Numbers 24: 17 to a rising star, in Isaiah 60:6 to camels, gold, frankincense and myrrh and in Psalm 72:10b-11 to kings rendering tribute to another king, Matthew is on his own with the story of the "magi from the East." Nothing else in the other canonical gospels parallels what is related here. One suspects that the story served a particular Matthean agendum, and it might be the path Matthew set out for himself in the matter of the inclusion of Gentiles in the emerging Jesus Jew communities. Already in 1:1-16 and 18-25, Matthew has legitimized Jesus for Jews. Now he demonstrates that Jesus is accessible to Gentiles as well -- but in good James-Peter Jerusalem style, i.e. that they come humbly (see Galatians 2:11-14).
Μάγοι were certainly not unknown in antiquity. Herodotus spoke of priests called μάγοι among the Medes and of their descendants as priests of Zoroaster. The book of Daniel (see 1:20. 2:2) mentions μάγοι as "magicians." These were generally associated with pre-astronomy and astrology. So the type probably would have been known to many of the communities out of which the Gospel according to Matthew came. In addition, Luke in Acts 8:9-13 wrote of one Simon who "had previously practiced magic (μαγεύων) in the city."
Modern astronomy gives a flicker of verisimilitude to Matthew's tale, for there was a triple conjunction of Jupiter, Saturn and Mars in 7-6 B.C.E. at about the time the Jesus of the gospels would have been born if the cross-referencing of dates from biblical and extra-biblical sources is correct. Herod died in 4 BCE, according to Josephus (Antiquities, Book 17, Ch. 6 and 9); and Luke 3:1 and 23 indicate that Jesus was born during the fifteenth year of Tiberias Caesar, which would have been 27 or 28 CE and began his work "when he was about 30 years old." We may assume, further, that the author(s) and editor(s) of Matthew, ca. 80 CE, knew about what must have been that extraordinary celestial display some 80 and more years before, and combined it with his and others' knowledge of Persian magician/astrologers to create the story of the Star of Bethlehem.
The placing by Matthew of the words "king of the Jews" on the magi's lips has an effect similar to his bold declaration in 1:1 and 18 that already Jesus was the Christ. How did Matthew think it would be credible to have the wandering magi know that "star" heralded the birth of a Jewish king? Is Matthew making an allusion here to Numbers 24:17, viz. "There shall a star from Jacob come forth, and a scepter from Israel rise up"? Is it then conceded to the magi that they are apt to know by divination things hidden from others?
Certainly Herod, a Roman puppet, would not have been interested in competition from the people of the land, which is what Jesus as portrayed by the evangelists would have been. Perhaps Matthew's story is a veiled way of saying that Rome had no puppet in Jesus as he would become in the movement of Jesus Judaism an icon of leadership, if not a king. Herod was also the renovator of the Second Temple that, in the eyes of first-century CE Jews, had been replaced by the risen Christ.
Where Matthew's story goes from there, as the magi are dispatched by a troubled Herod who meanwhile has found out from his priests about Micah's prophecy (5:2), is through three more dream sequences -- each, as it were, a literary deus ex machina. The first and second serve to get Joseph, Mary and Jesus into Egypt, and after Herod's demise, out again. The aim is to fulfill, as Matthew would say, Hosea 11:1: "Out of Egypt have I called my son." The third is to get them to Galilee, possibly to fulfill yet another "prophecy" -- this from Isaiah 11:1: "And a shoot shall come out from the stump of Jesse (that is Judea), and a branch grow out of his roots (toward Galilee)." It is interesting to note that the Hebrew words we translate "shoot" and "branch" constitute the probable root of the name "Nazareth," a village in the lower Galilee.
The presentation of costly gifts may be Matthew's way of saying to the Jews of his communities that Gentiles may become adherents of Jesus Judaism, but it will cost them. Cost them what? See Matthew 16:24-26.
* * * * *
Matthew has created one of the most memorable stories in scripture. Although it was long ago co-opted for the celebration of Epiphany, its imagery is by common consent part of the Christmas tableau. The homilist will want to treat it for what it is rather than what it is not. It is not a story of something that occurred. It is, rather, an imaginative word picture that conveys a sense of temporal and spatial expansiveness to the appearance of Jesus, who, on one level would have been born just like any other human being and probably to landless laborers (J. Dominic Crossan), but who in the mythology of the gospels became a figure of such universal import that celestial phenomena could cause alien magicians and divinators to seek him out.
This is very good mythology, and as long as it is treated of as myth and poetry, the more the homilist and the bible class teacher will be able to illuminate the artistic beauty of this particular part of scripture for their listeners and participants without ruining the experience by taking it anywhere near literally.