herod did it so that no one could overthrow him in his throne
In the bible the king who was ruling Bethleham was king Herod.
They met with Herod, who tried to extract information from them to kill Jesus. --Matthew chapter2
Herod the Great wanted to kill Jesus. When Joseph, Mary and Jesus fled to Egypt, Herod had no authority there. Even if he could have sent men into Egypt to kill Jesus, they probably could not have found the family.
You're probably thinking of Herod the Great. According to Matthew chapter 2, Herod ordered that all children of Bethlehem (not Jerusalem) age two and under be killed.
King Herod had soldiers kill every baby under the age of 2 in Bethlehem.
Supposedly in Bethlehem initially; unfortunately there is not documentation of a town named Bethlehem in any historical records. Then they lived for a time in Egypt, then Nazareth before he went on the road full time.
According to the Bible, Herod ordered the killing of all male infants in Bethlehem, an event known as the Massacre of the Innocents. The exact number of babies killed is not specified in historical records, but it is believed to have been a relatively small number due to Bethlehem's size at the time.
Jesus escaped to Egypt from Bethlehem, not Nazareth. King Herod, who wanted to kill him, ordered the massacre of all infant boys in Bethlehem, prompting Joseph and Mary to flee to Egypt with Jesus to keep him safe.
King Herod had heard that another King was born; and since there could only be one king he though Jesus had come to depose him. So he wanted to kill Jesus before Jesus could take the kingdom away from him.
King Herod ordered the killing of all children aged two or under, in the hope that he would kill the future king of the Jews.
Mary and Joseph fled to Egypt with Jesus, so Africa.
Herod the Great attempted to kill Jesus as a baby, for fear this 'king' was a threat to his rulership, as was prophesied at Jeremiah 31:15 and Hosea 11:1. (Matthew 2:1-18)