Revenge and retribution are different. When you get revenge, you can do more to the person than they did to you. Retribution is limited by what the person deserves.
Gen 4: 23-24 23 Lamech said to his wives,
“Adah and Zillah, listen to me;
wives of Lamech, hear my words.
I have killed a man for wounding me,
a young man for injuring me.
24 If Cain is avenged seven times,
then Lamech seventy-seven times.”
That's revenge, but not retribution.