The idea of paying damages for causing “pain and suffering” seems to be a modern invention, created by lawyers to maximize the benefits of lawsuits.
To my surprise, I discovered that in fact, the concept originates in the Torah. There is a specific example of damages that are assigned based on the mental trauma that is experienced by parents of a premature birth!
Here is that verse: (E. 21:22) When men fight, and one of them pushes a pregnant woman and the baby is born prematurely but alive, the one responsible shall be fined as the woman’s husband may exact from him, the payment to be based on prayers.
I recognize that this translation is not common – but it is as accurate a reflection of the original words as a translation can be.
Which prompts the question: whose prayers? The answer suggests itself: a woman goes into labor as a reaction to the physical trauma experienced during a violent altercation. What are the parents feeling as a result? Terrified that something may have gone wrong to injure the mother or the child! And what do they do as a reaction to that terror? They pray. They ask G-d to intercede on behalf of those who have been potentially harmed because of the violence.
And while they pray, they are gripped with fear and regrets, desperate to save both lives: the mother and the baby. Thus, the man who struck the pregnant woman has to pay damages for the “pain and suffering” experienced as a result of his violence.
P.S. This use of “prayer” in this verse matches that found throughout the text (“prayer”, palal, is found 9 times in the Torah): prayer is directly toward G-d, asking for intercession, and for the sake of life. Avraham prays for the sake of Avimelech and his infertile wives, just as Moshe prays for the sake of the Jewish people and Aharon. So understanding this verse as “based on prayers” matches the way the word is used elsewhere in the Torah.