Quoted from uCatholic [1]:
Herod “the Great,” king of Judea, was unpopular with his people because of his connections with the Romans and his religious indifference. Hence he was insecure and fearful of any threat to his throne. He was a master politician and a tyrant capable of extreme brutality. He killed his wife, his brother and his sister’s two husbands, to name only a few.Matthew 2:1-18 tells this story: Herod was “greatly troubled” when astrologers from the east came asking the whereabouts of “the newborn king of the Jews,” whose star they had seen. They were told that the Jewish Scriptures named Bethlehem as the place where the Messiah would be born. Herod cunningly told them to report back to him so that he could also “do him homage.” They found Jesus, offered him their gifts and, warned by an angel, avoided Herod on their way home. Jesus escaped to Egypt.Herod became furious and “ordered the massacre of all the boys in Bethlehem and its vicinity two years old and under.” The horror of the massacre and the devastation of the mothers and fathers led Matthew to quote Jeremiah: ... (Matthew 2:18) ...
Matthew 2:18 from BibleGateway - New International Version [2]:
“A voice is heard in Ramah,weeping and great mourning,Rachel weeping for her childrenand refusing to be comforted,because they are no more.”[d]
[2] https://www.biblegateway.com/passage/?search=Matthew+2%3A18&version=NIV, footnote [d] refers to Jer. 31:15 (click on Read full chapter link to see it)