Nobody ever said that the story of Jesus’s birth was about what you know. The story is, like everything else in Christianity, about Who you know. I get that and I’m fine with it. Mostly. But the truth is that the less of any commodity there is, the more we are attracted to it and there aren’t very many really smart people in the birth narrative of the gospel of Matthew.
There are three for sure, though, counting all three magi as one. In the order the story gives us, they are: the magi, King Herod, and Joseph. The magi were what we would call astrologers today but that was before astronomy diverged from astrology. The reason for studying the laws of the stars (the –onomy part) is that they would tell us things (the –ology part). After all, you have to know a lot about stars to recognize a new one.
The new star told the magi that a new king was going to be born in Israel. So what did they do: follow the star to Jerusalem? Nope. They consulted a really good political atlas and determined that Jerusalem was the capital of Israel and so, logically, where the new king would be. Then they packed up and headed for the capital of Israel to talk to the current king.
I like the magi for other things too, of course. They promised a powerful king that they would return from their field studies to tell him what they had learned. They had promised, from our perspective in history, to rat out Jesus. But when they had a dream telling them not to go back to Herod at all, they obeyed. A king as nearly paranoid as Herod very likely had agents all over the kingdom telling who was going where and why, so it wasn’t a risk-free choice to sneak back to wherever they were going—Iran, probably—against the wishes of the king, but they did it anyway.
In doing so, however, they set up the massacre of a bunch of little boys who had not reached their Terrible Two’s yet and who, now, never would. It is hard to call Herod smart because he was also evil, but there is nothing irrational about Herod’s interest in learning the identity of the king who would supplant him and his own sons and doing what he could to safeguard his own political power. Rome was going to judge Herod on how well he did at the one thing Rome cared about a good deal—keeping the peace. Preventing a civil war over who was to be king in Israel would likely get messy and if it did, Herod could look forward to being booted out by the Romans even if he won the war. So, like Pilate at the other end of Jesus’s life, Herod scoped out what his office required of him and did it promptly.
The third, in the order of the story, is Joseph. Joseph had not done anything so far in Matthew’s story that I would call “smart.” Lots of other good things: compassionate, obedient, thorough, prompt. He hauled his family off to Egypt promptly when he had the dream in which the angel told him to go and if he had not, Jesus would have been among the not-yet-Terrible-Two’s who were massacred in Bethlehem. But that wasn’t the smart part. Joseph and his family stayed in Egypt until Herod died. Then the angel told him it was time to go “home.” But where to go?
In Matthew’s account, Joseph and Mary had never lived anywhere but in Bethlehem. The onerous “journey to Bethlehem” is all Luke’s. But whose political district would they be living in in Bethlehem. The angel just said to go back to Israel. It was Joseph’s job to figure out where in Israel Jesus would have the best chance of actually growing up. He picked Nazareth because Herod’s son Herod Antipas would be the ruler there and Joseph calculated that his family would be safer under Antipas than under his brother, Archaelus, who would be ruling over Judea. Why? Did Antipas have fewer political ambitions than Archaelus, who would rule the territory that included Bethlehem? Was he just less competent than his brother? Had better National Security Advisors?
We don’t know, of course, but all those calculations are the kind that only a guy with substantial smarts would make and I have to say I really admire him for that. As well, of course, for all the other things—such as postponing the period of Mary-making that would ordinarily have followed their marriage. Good guy, that Joseph. The patron saint of stepfathers everywhere.
 Many people will want to say that it is about Who knows you, but that leads into a very dark part of the woods. Who does God not know? See? Now already we are into “knows-1,” one kind of knowing and “knows-2,” another kind. I don’t think I want to spend my limited supply of bullets on the question of just how God knows whom.
 Raymond Brown in The Birth of the Messiah, cites the historian Josephus to the effect that Archaelus inaugurated his reign with the slaughter of 3000 people and continued until he was deposed by Rome at the request of his subjects. Joseph’s judgment that Jesus would be safer under Antipas than under Archaelus was quite sound.