2:178 O you who believe! Retaliation law (Qisasu) is prescribed to you in cases of murder: the free for the free, the slave for the slave, the woman for the woman. And if something [of his guilt] is remitted to a guilty person by brother of the slain, then this (remission) shall be follow up with fairness and compensate/pay him with kindness, this is a concession and a Mercy from your Lord. After this whoever exceeds the limits shall be in grave penalty.
2:179 In retaliation law (Qisasu) there is a life for you, O you who possess intelligence, that you may remain conscious of God.
By saying “the free for the free, the slave for the slave, the woman for the woman” it is intended to negate absurd demand of killing in retaliation by the tribes at the time of prophet that
A free man should be killed in retaliation for killing a free man, even though he may not be the killer.
A salve should be killed in retaliation for killing a slave and even though he may not be the killer.
A woman should be killed in retaliation for killing a woman even though she may not be the killer.
This barbaric law was replaced by the Retaliation law (Qasis) from God.
This means a person who killed another person must be hold responsible and punished according to the law.
So the just law that Islam enforces was that the killer is the one who has to be killed in Qisas.
Also God introduced his mercy within the law by giving permission to the victim family to remit the guilty person. This guilty person allowed to compensate the family/heir of a person who was killed by paying a reasonable amount.
17:33 And do not take a life, for God has made this forbidden, except in the course of justice. And whoever is killed innocently, then We have given his heir authority, so let him not transgress in the taking of a life, for He will be given victory.