Let's say Somu kills Kumar.
Did Kumar deserve it? Yes. Why? Shastras tell us Law of Karma decides your birth & death. So Kumar deserved to die exactly at that time in that manner.
So, can we let Somu go free? No. Why not? Because Somu committed a crime.
How can it be a crime if Kumar deserved it? Because Shastras tell us that murder is a crime.
But if murder is a crime, how will Kumar get the death he deserves according to Karma? Shastras give the right of execution only to Raja (king/government/judge/police).
So if King executes Kumar, isn't it also murder? No. Why not? Because Shastras says that King must uphold justice by executing criminals. If Kumar committed a murder in this birth that the King knows about, then the King will execute him. But if he committed a murder in his previous birth, then the King cannot execute him because King cannot see into past lives. But Bhagavan can. So Bhagavan will ensure that Kumar gets the death he deserves. Whether it be through another criminal, or an accident, only Bhagavan will decide. Humans CANNOT decide.
Somu is just a means through which Kumar gets his deserved punishment. There is no contradiction.
...
Kumar killed Pappu. (Pappu's punishment is over, Kumar committed a crime)
Somu killed Kumar. (Kumar's punishment is over, Somu committed a crime)
Binny killed Somu. (Somu's punishment is over, Binny committed a crime)
King killed Binny. (Binny's punishment is over, King did not commit crime)
-end of chain-
Suppose that Kumar hurts Pappu. What should Pappu feel ? What should Kumar feel ?
Pappu should not feel angry to get revenge. He should feel relieved that his own paap (sin) balance got reduced through the punishment, which just happened to come through Kumar.
Kumar should feel afraid and guilty because his paap (sin) balance just got increased because he did adharma.
If Pappu does not punish Kumar in revenge, who will punish him ? Bhagavan.
How ? Maybe some other person, Somu will cut off Kumar's hand, maybe Kumar will lose his hand in an accident, or maybe he will just get a fracture, or maybe just a skin-rash. if he repents and does prayaschitta. We have no idea how or when Kumar will get what he deserved. All that is true is that he will. Just as Pappu got what he deserved.
So how will I know what I deserve and what I don't ?
Simple. Whatever happens to you, you deserved it.
If you don't want bad things to happen to you, follow dharma. If you want good things to happen to you, follow dharma. You have no say in who/how/when these consequences will happen, but they will, as long as Bhagavan is the enforcer.
Can this be used to justify crimes against Shudras and Dalits? They were born that way so they deserve to be oppressed.
Again, there are 2 parties involved - the oppressed and the oppressor. Again, lookup dharma. Does it say you are allowed to oppress ? If yes, then go ahead. If not, then don't.
What will happen if I still oppress against dharma?
Most likely, you will be born as Shudra/Dalit in next life, and that person will be born as born as brahmin, and he will oppress you. There is a precedent for this, from the word 'Mamsah'
So if someone is suffering from disease, or handicap, or injury, should I just let him suffer because he deserved it?
Once again, lookup dharma. Does dharma say you should ignore him ? No. It says you should help them, show mercy.
Otherwise, what will happen?
When you are suffering as a result of your karma, no one else will come to your aid.
Why can't Bhagavan show that mercy and not punish him in the first place?
No - mercy is reserved for the deserving. A criminal, as soon as he gets his punishment, becomes deserving of mercy - rehabilitation, preventing further crimes etc.
But what use is mercy AFTER punishment has been given out?
Mercy was shown even before punishment. Ever wondered by punishments are not immediate ? Deivam Nindru Kollum ? That period is chance/mercy given to repent and do prayaschitta. But the criminal did not. So he will be punished. As soon as he has undergone punishment, he is deserving of mercy like everyone else.
If Somu had used his buddhi/manas to control himself instead of killing Kumar, then Kumar will have time to repent, and if he doesn't, will eventually be punished by King.
If Binny had controlled himself, then Somu will have time to repent, and if he doesn't, will eventually be punished by King.
But neither did. They interfered and disobeyed shastras, so they will also be punished.
In other words, if you follow shastras, you will not be punished.
You do not have the right to commit a crime and then say the victim deserved it.
If you say so, then police will punish you and say you deserved it.
Source - https://www.wisdomlib.org/hinduism/book/brahma-sutras
Brahma-Sutra 3.2.38: फलमतः, उपपत्तेः