When Herod realized he'd been fooled by the wise men, he got very angry. He sent men to kill all the young boys in Bethlehem and the regions nearby who were two years old and under. This was based on the time frame he'd discovered from the wise men.
This fulfilled the prophecy spoken through the prophet Jeremiah: “They took thirty silver coins—the ‘value’ of the one who was bought at the price set by some of the children of Israel—