In roman times, if someone killed your cousin you could go to court and it would mostly end there. After the collapse, if someone killed your cousin your family had the right to kill someone of "equal value" from the family of the killer. Aside from the brutality and senseless violence (as seen from us today), the biggest problem was that people disagreed on "equal value", resulting in a feud, i.e. an escalation of revenge because each party felt that the other side's killing was way more than warranted to make things even.
So the states (starting from the early barbarian kingdoms) would encourage the family of the killed to accept a monetary payment to avoid the murders to spiral out of control. See https://en.wikipedia.org/wiki/Weregild. I think the concepts of feud and weregild did not even exist in the roman world.
But you are right that for a long time you still had the right for revenge, until eventually it was fully phased out. A bit like the transition between the gold standard and fiat currency.