The New Testament can be confusing at times, as there were at least 6 different Herods!
The name Herod is one that is commonly associated with the “slaughter of innocents” that occurs during the first few years of Jesus’ earthly life. However, Herod is mentioned again later in the Gospels as well as in the New Testament letters.
These Herods are not the same, as it was a name taken by at least 6 different rulers of Judea.
The first Herod during Jesus’ life is believed by scholars to refer to “Herod the Great,” who ruled from 37-4 B.C. Most historians date Jesus’ birth between 6 and 4 B.C. to coincide with this Herod’s reign.
It is this Herod who ordered the “slaughter of innocents” mentioned in Matthew 2:16, which was the primary reason why St. Joseph was warned by an angel to take his family into exile, fleeing to Egypt.
After this particular Herod died, a new “Herod” came to rule during Jesus’ childhood, known by historians as Herod Archelaus. It was during his rule that St. Joseph was allowed to return to Israel, but this Herod wasn’t much better and Joseph was warned again to avoid the region of Judea.
But when he heard that Archelaus reigned over Judea in place of his father Herod, he was afraid to go there, and being warned in a dream he withdrew to the district of Galilee. (Matthew 2:22)
Later on there are many other Herods mentioned in the Gospels and the New Testament. If you would like to better understand these “Herods,” the Biblical Archeological Society has a very instructive Herodian Family Tree that helps identify which Herod did what in the Bible.