Mark's overture tells the story of John the Baptist's mission and arrest as overture to that of Jesus. John's overture is a magnificent hymn to the Logos of God, Word made Flesh.
Matthew and Luke, however, both chose a birth story as overture to their own stories of Jesus. Let's examine Matthew's overture to see what he was trying to say about Jesus with his birth story. For Matthew, Jesus is the Messiah, long-awaited by his people, but a Messiah who came as a New Moses. You and I, by the way, understand new rather differently from the way that Matthew did. We think of "new" as "better" and therefore replacing the obsolete old. But for the ancients, the old was good and the new was always suspect--except as the old renewed, transfigured, and fulfilled. That is why, for example, Matthew started his story of Jesus-as-Adult atop a (re)new(ed) Mount Sinai, giving a (re)new(ed) Torah, and proclaiming "you have heard of old, but I tell you now" in Matthew 5-7. Torah-renewal, in other words, not Torah-replacement. That is why Matthew has Jesus explicitly warn, "not to think that I have come to abolish the law or the prophets; I have come not to abolish but to fulfill."
In composing his birth-as-overture, therefore, Matthew had to write a prologue about Jesus the Messiah, the New Moses of Jews and Gentiles alike. And here was the most difficult part. He also had to foreshadow danger and deliverance, lethal human opposition but eventual divine vindication. He had to hint about crucifixion and resurrection in creating his parable about the newborn Jesus. Finally, he had to do all that in the short space of those two initial chapters.
You can debate whether Matthew's birth story is history or parable. In my own view, it is clearly a deliberate and very powerful parable. But what does it mean? And there is an even more important question which still presses, whether you take it literally as history or metaphorically as parable. It is also the only question Matthew would have thought worthy of debate: Who is your King and what is your Rule? Is it the violent power of a Herod or the non-violent power of a Jesus?
Back, then, to Matthew's birth story. His obvious strategy was to describe the birth of Jesus in parallel with the birth of Moses in Exodus 2. In that story, Pharaoh of Egypt tried to destroy the Israelites by killing all their male infants--but the bravery of the Hebrew midwives, the strategy of his mother Jochebed, and the decency of Pharaoh's own daughter (all females, you will notice) saved the child in his papyrus basket among the reeds of the Nile.

