score:2
Dual-fulfillment prophecy
This is a dual-fulfillment prophecy - that is, the prophet states something that will happen more than once, such as having a temporal fulfilment and a spiritual fulfilment, or an application in his day and an application at one (or both) comings of the Messiah:
Isaiah is particularly well-known for this, e.g.
Isaiah spoke in such a manner that his words find application and fulfillment in many different ages or events in world history. (see Ludlow Isaiah - Prophet, Seer, and Poet p. 54)
The same appears to be true of this prophecy of Jeremiah.
--
Application to Ancient Israel
As summarized by Ellicott's Commentary:
Historically, as we find from Jeremiah 40:1, this [Ramah] was the place to which the prisoners were dragged, that Nebuzaradan might assign “such as were for death” to death, others to exile, and others again to remain as bondsmen in the land. That picture, St. Matthew felt, had been reproduced once again.
Ramah was thus a place of sorrow for the descendants of Rachel.
--
Application to Bethlehem
According to Genesis 35:19, Rachel's tomb is in Bethlehem.
Ellicott puts the pieces together in this way:
Rachel, as the great “mother in Israel,” seeing, as from the “high place” of her sepulchre...
The word Ramah means "high place" or "hill". From her prominent sepulcher a cry is heard as Rachel's descendants (in Bethlehem, by her tomb) mourn for their lost children. Matthew saw an application of Jeremiah's words in the events surrounding the Messianic arrival in Bethlehem.