16 When Herod realized that he had been outwitted by the Magi, he was furious, and he gave orders to kill all the boys in Bethlehem and its vicinity who were two years old and under, in accordance with the time he had learned from the Magi. 17 Then what was said through the prophet Jeremiah was fulfilled:
18 “A voice is heard in Ramah,
weeping and great mourning,
Rachel weeping for her children
and refusing to be comforted,
because they are no more.”
Interestingly, Jesus might have been spared had he just gone up with his parents to Nazareth, since Herod was taking out his wrath on metro Bethlehem.
The inhumanity of taking out whole populations of toddlers is a head-shaker, but humans do have a way of doing nasty things to hang on to power. Herod didn't quite have absolute power, given that he was a vassal of Rome, but his large power was largely corrupting.