If you put the first two chapters of Matthew and the first two chapters of Luke together, you can basically plot the first 40 days of Jesus life with a good bit of detail. Both Matthew and Luke record the day of Jesus’ birth in Bethlehem (day 1).
Luke tells us he was circumcised on his 8th day, in accord with the covenant. This was also the day he officially received his name, Jesus, as commanded by the angel.
Luke later records the 40th day of his life when his parents took him to the temple to offer sacrifice according to the law (2:22-38). Some have suggested Leviticus 12 does not require the woman to present herself for purification on the 40th day after a male child is born, but on any day afterwards. But Luke uses the same formula for Mary’s presentation in the temple that he used to mark Jesus’ circumcision (“when the days were completed…”), which suggests Mary was at the temple on the 40th day.
Simeon and Anna met Jesus on this 40th day in the temple. Then Jesus’ family went to live in Nazareth. Luke 2:39 and Matthew 2:23 record the same event, when the holy family settled in Nazareth.
Luke does not record the flight to Egypt, so where does it fit in? It had to happen before the 40th day since afterwards they went to Nazareth (not back to Bethlehem). Most likely, they made a quick sojourn to Egypt, stopped off at the temple on the way home, then settled in Nazareth for good.
All the events of Jesus’ life that took place in Bethlehem had to take place before the 40th day because they did not return to Bethlehem after they went to the temple. That means the flight to Egypt also had to take place within the first 40 days of his life since they returned from Egypt to live in Nazareth. And that means that if the magi did not visit Jesus on the same night as the shepherds, the night of Jesus’ birth, it was very shortly afterwards. (I think it’s fitting, and therefore likely, that the Gentile magi worshipped baby Jesus alongside the Jewish shepherds on the very night he was born. Church tradition places their visit on the 12th day of Jesus life, and thus the visit of the magi is often connected to Epiphany more than the Christmas season. Thematically, the magi certainly fit with Epiphany, but there is no reason in the text to delay their visit chronologically.)
Herod killed baby boys in Bethlehem under two years old based on when the star first appeared to the magi, which was long before they arrived in Jerusalem (Matthew 2:7). Jesus obviously did not live in Bethlehem for anywhere close to two years since by day 41 he was in Nazareth. The holy family probably financed their trip to Egypt with the gifts the magi brought, which is why they had to make the offering of the poor when they arrived at the temple for the 40th day purification (Luke 2:24). They had been on the run and funds were low from their travels. My guess is that the magi hung around in Bethlehem for a few days after Jesus was born, then departed (Matthew 2:12). As soon as they left, Joseph had his vision of danger, telling him to flee to Egypt (Matthew 2:13-15). When Jesus was around a week old, they fled the country. Herod died quickly thereafter and they made their return to Israel just in time to get to the temple on the 40th day. There’s no reason they could not have made the trip to Egypt and back within 3 or 4 weeks, certainly within the 40 day window.
We do not know how many magi there were, though it is often assumed there three because they brought three gifts. They were not technically kings but are associated with kingly office and were part of the royal court. They were probably the Spiritual descendants of Daniel, who was a sort of magi himself and had witnessed to the true God while in exile in the East centuries earlier. I believe the magi were not pagans, but Gentile God-fearers.
The visit of the magi is associated with the prophecy of Isaiah 60. Isaiah spoke of kings, not magi, bringing treasures to God’s messiah, but magi operated under the aura of kingship so their association with royalty is sufficient to see them as an initial fulfillment of the prophecy. Isaiah spoke of Gentile royalty bringing gold and frankincense, which the magi did. There’s a good chance the magi knew Isaiah’s prophecy and brought these specific gifts because of Isaiah’s words. They also brought myrrh, a burial spice, indicating they may have been familiar with other parts of Isaiah’s prophecy (e.g., chapters 52-53) which foretold his sacrificial death. In hymns, art, and manger scenes, the magi ride on camels. Matthew does not give us this detail, but Isaiah 60:6 does, so we should go with it.
Isaiah 60:1-9 links the royal Gentiles bringing gifts to the glory that has arisen in the sky. We can rightly connect the glory of Isaiah 60:1 to the star of Matthew 2:2. It is this glory-star that drew the magi to Jesus.
The star is obviously not planetary or astronomical. The star guides the magi to Jerusalem, and then stands over the particular house where baby Jesus is. No astronomical body could pick out a particular house. Something else is going on. This is not ordinary star. The star is likely an appearance of the shekinah-glory. (The word “shekinah” is not found in the Bible, but the related word “shakan” is found 128 times. “Shekinah” is the word typically used for visible manifestations of God’s presence/dwelling/glory with his people in its various forms, such as the pillar of cloud and fire.)
The star appears to be another manifestation of the same glory that guided Israel through the wilderness after the exodus. The same language is used for the star and the shekinah in various places, e.g., the star “went before” them and “stood over” a place, which is exactly what the shekinah does in various Old Testament texts. The star and the pillar of cloud and fire both play a similar navigational function.
The shekinah-glory led the magi to the true revelation of God’s glory in baby Jesus. But that’s not all. In the Old Testament, stars are associated with angels (eg, Job 38:7) and the angel of the Lord is associated with the shekinah-glory. In Luke 2, an angel appears to the shepherds and the shekinah-glory of the Lord shone about them (2:9). It’s as if the lowly shepherds have been transformed into priests and transported into the heavenly sanctuary, where the glory of God dwells. Heaven is opened to them. The angel, surrounded by the glory cloud, announces to them the birth of the promised messiah-king.
Further, just as the magi rejoiced over the star-shekinah (Matthew 2:10), the angel, surrounded by shekinah, brought “good news of great joy” to the shepherds (Luke 2:10). The star-shekinah and the angel-shekinah have the same effect: great joy!
My hunch is as follows: the shekinah-glory that appeared in the sky and led the magi to the very house where Jesus was is the exact same shekinah-glory that appeared in the sky with the angel to announce Jesus’ birth to the shepherds. The shekinah-glory in the sky led the shepherds and magi (on the same night?) to the full revelation of God’s glory on earth, in baby Jesus. Perhaps the angel surrounded by a cloud of glory looked like a star from a distance. Perhaps the magi and shepherds were looking at the exact same phenomenon in the sky, just as they would worship the same Savior on earth in the manger. The glory-star and the glory-angel are pointers to the One in whom we behold the glory of God, the Lord Jesus (John 1:14).