One of the things I really love about the Bible is its cohesiveness, the way so much of the Old Testament foreshadows the New Testament. As my pastor has been working his way through Matthew 2 (the arrival of the Magi in Jerusalem, Herod learns that a king is born, the Magi make their way to the child, Herod panics and orders all the children of Bethlehem killed), I recalled the similar situation in Exodus.
Exodus 1:8-16 Now a new king arose over Egypt, who did not know Joseph. He said to his people, “Behold, the people of the sons of Israel are more and mightier than we. Come, let us deal wisely with them, or else they will multiply and in the event of war, they will also join themselves to those who hate us, and fight against us and depart from the land.” So they appointed taskmasters over them to afflict them with hard labor. And they built for Pharaoh storage cities, Pithom and Raamses. But the more they afflicted them, the more they multiplied and the more they spread out, so that they were in dread of the sons of Israel. The Egyptians compelled the sons of Israel to labor rigorously; and they made their lives bitter with hard labor in mortar and bricks and at all kinds of labor in the field, all their labors which they rigorously imposed on them. Then the king of Egypt spoke to the Hebrew midwives, one of whom was named Shiphrah and the other was named Puah; and he said, “When you are helping the Hebrew women to give birth and see them upon the birthstool, if it is a son, then you shall put him to death; but if it is a daughter, then she shall live.”
It was because of that order, that Moses was supposed to be killed and instead his mother hid him, then placed him in a basket in the Nile to save his life. Moses grew up and became the deliver of the Israelites (their savior) and a type/foreshadowing of the Messiah to come (Jesus).
It’s clear from Matthew 2 that Herod was gripped by a similar fear as the king of Egypt. When the Magi informed him that a King of the Jews was born, Herod wasn’t going to be usurped and he set out to find and kill the child.
Matthew 2:9-18 After hearing the king, they went their way; and the star, which they had seen in the east, went on before them until it came and stood over the place where the Child was. When they saw the star, they rejoiced exceedingly with great joy. After coming into the house they saw the Child with Mary His mother; and they fell to the ground and worshiped Him. Then, opening their treasures, they presented to Him gifts of gold, frankincense, and myrrh. And having been warned by God in a dream not to return to Herod, the magi left for their own country by another way.
Now when they had gone, behold, an angel of the Lord appeared to Joseph in a dream and said, “Get up! Take the Child and His mother and flee to Egypt, and remain there until I tell you; for Herod is going to search for the Child to destroy Him.”
So Joseph got up and took the Child and His mother while it was still night, and left for Egypt. He remained there until the death of Herod. This was to fulfill what had been spoken by the Lord through the prophet: “Out of Egypt I called My Son.”
Then when Herod saw that he had been tricked by the magi, he became very enraged, and sent and slew all the male children who were in Bethlehem and all its vicinity, from two years old and under, according to the time which he had determined from the magi. Then what had been spoken through Jeremiah the prophet was fulfilled:
“A voice was heard in Ramah,
Weeping and great mourning,
Rachel weeping for her children;
And she refused to be comforted,
Because they were no more.”