These passages seem to set forth clearly lex talionis aka "the principle of retaliation," at least in the case of bodily harm or murder:
[Exo 21:24 NLT] (24) an eye for an eye, a tooth for a tooth, a hand for a hand, a foot for a foot,
[Lev 24:20 NLT] (20) a fracture for a fracture, an eye for an eye, a tooth for a tooth. Whatever anyone does to injure another person must be paid back in kind.
[Gen 9:6 NKJV] (6) "Whoever sheds man's blood, By man his blood shall be shed; For in the image of God He made man.
So when David had, by proxy, murdered Bathsheba's innocent husband Uriah the Hittite, he accrued bloodguilt. The Torah said that he must be killed. However, he was not killed. Instead, he was freely forgiven and went on to be a celebrated hero of the LORD.
Thus, God became open to the charge of injustice, and being derelict in his duty:
[Gen 18:25 NKJV] (25) "Far be it from You to do such a thing as this, to slay the righteous with the wicked, so that the righteous should be as the wicked; far be it from You! Shall not the Judge of all the earth do right?"
And Jesus set aside the whole concept of lex talionis:
[Mat 5:38-42 NLT] (38) "You have heard the law that says the punishment must match the injury: 'An eye for an eye, and a tooth for a tooth.' (39) But I say, do not resist an evil person! If someone slaps you on the right cheek, offer the other cheek also. (40) If you are sued in court and your shirt is taken from you, give your coat, too. (41) If a soldier demands that you carry his gear for a mile, carry it two miles. (42) Give to those who ask, and don't turn away from those who want to borrow.
In the Substitutionary Theory of the Atonement, the death of Christ satisfies justice by saying that the death of the son of God was so "valuable" that it was "worth the bloodguilt related to every sinner's guilt, so when Jesus suffered and his blood was shed, it "paid for" and "vicariously suffered" the punishment of every sinner's crimes.
However, this does not accord with lex talionis because in that jurisprudence, it is the sinner that receives the payback. So instead of "the principle of retaliation," substitutionary atonement is an example of the principle that "two wrongs make a right". It is a jurisprudence that says that justice can be served either by the sinner being punished and the righteous rewarded OR by the righteous being punished and the wicked rewarded. Thus Substitutionary Atonement is a nonsensical approach to justice. I like to summarize its logic like this:
"You raped my daughter? Okay, well then how about if you kill my son and then we'll call it even." Absurd, of course. Two wrongs do not make a right.
Paul explains that God's plan of salvation is not about justice at all. It is about mercy triumphing over justice:
[Jas 2:13 NKJV] (13) For judgment is without mercy to the one who has shown no mercy. Mercy triumphs over judgment.
[Act 17:29-30 KJV] (29) Forasmuch then as we are the offspring of God, we ought not to think that the Godhead is like unto gold, or silver, or stone, graven by art and man's device. (30) And the times of this ignorance God winked at; but now commandeth all men every where to repent:
[Rom 3:23-26 KJV] (23) For all have sinned, and come short of the glory of God; (24) Being justified freely by his grace through the redemption that is in Christ Jesus: (25) Whom God hath set forth [to be] a propitiation through faith in his blood, to declare his righteousness for the remission of sins that are past, through the forbearance of God; (26) To declare, [I say], at this time his righteousness: that he might be just, and the justifier of him which believeth in Jesus.
To unpack that...
- God freely forgave David and others
- He set forth his crucified Son before his subjects as a propitiation, not to satisfy justice and not to make himself more disposed to forgive, but satisfy his subjects - especially those like Uriah, who were victims of the forgiven - that the Judge had Himself borne the murder of his beloved Son and forgiven his murderers, just as he asks them to do, so that God can be counted merciful and kind rather than negligent and feckless as the Judge.
- in this way he is vindicated as Judge and as Forgiver In Chief of all who trust in Jesus.
The body and blood of Jesus also was the requisite bloody corpse that was used to seal an ancient blood covenant, in the case of the New Covenant. It seems to indicate that if God fails to forgive sins, he becomes subject to being killed just as the corpse was and if his subjects do not keep covenant, they too will be destroyed.
There is also the suffering of Jesus himself which, though measured and very limited compared to many people's deaths, did show that he had "skin in the game" so to speak, making him a qualified and compassionate high priest, to intercede on behalf of the sinner that approaches his mercy seat.
In the OT, though, the blood of the sacrifices served primarily as an atonement. IE: An expression of remorse, an appeal for mercy and a commitment to turn from that behavior.
Click here for a related answer.