In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Allaah [The Exalted] said:
يَـٰٓأَيُّہَا ٱلَّذِينَ ءَامَنُواْ كُتِبَ عَلَيۡكُمُ ٱلۡقِصَاصُ فِى ٱلۡقَتۡلَىۖ ٱلۡحُرُّ بِٱلۡحُرِّ وَٱلۡعَبۡدُ بِٱلۡعَبۡدِ وَٱلۡأُنثَىٰ بِٱلۡأُنثَىٰۚ فَمَنۡ عُفِىَ لَهُ ۥ مِنۡ أَخِيهِ شَىۡءٌ۬ فَٱتِّبَاعُۢ بِٱلۡمَعۡرُوفِ وَأَدَآءٌ إِلَيۡهِ بِإِحۡسَـٰنٍ۬ۗ ذَٲلِكَ تَخۡفِيفٌ۬ مِّن رَّبِّكُمۡ وَرَحۡمَةٌ۬ۗ فَمَنِ ٱعۡتَدَىٰ بَعۡدَ ذَٲلِكَ فَلَهُ ۥ عَذَابٌ أَلِيمٌ۬
وَلَكُمۡ فِى ٱلۡقِصَاصِ حَيَوٰةٌ۬ يَـٰٓأُوْلِى ٱلۡأَلۡبَـٰبِ لَعَلَّڪُمۡ تَتَّقُونَ
O you who believe! Al-Qisas (the Law of Equality in punishment) is prescribed for you in case of murder: the free for the free, the slave for the slave, and the female for the female. But if the killer is forgiven by the brother (or the relatives, etc.) of the killed against blood money, then adhering to it with fairness and payment of the blood money, to the heir should be made in fairness. This is an alleviation and a mercy from your Lord. So after this whoever transgresses the limits (i.e. kills the killer after taking the blood money), he shall have a painful torment. And there is (a saving of) life for you in Al-Qisas (the Law of Equality in punishment), O men of understanding, that you may become pious. [Surah Al-Baqarah. Aayaat 178-179]
Ash-Shaybaan reported from Qataadah who said: Among the people of the pre-Islamic era were those who transgressed and followed shaytaan. If a person had strength and a great number of supporters, and a slave of theirs is murdered by a slave of another people, then out of wanting to show their superior strength, they would say, ‘We shall not kill (by way of revenge) except a free person amongst them’. And if a woman kills another woman from another tribe, they said, ‘We shall not kill (by way of revenge) except a man amongst them’”. So, Allaah revealed this Aayah.
And regarding the statement: [وَلَكُمۡ فِى ٱلۡقِصَاصِ حَيَوٰةٌ۬ يَـٰٓأُوْلِى ٱلۡأَلۡبَـٰبِ لَعَلَّڪُمۡ تَتَّقُونَ – And there is (a saving of) life for you in Al-Qisas (the Law of Equality in punishment), O men of understanding, that you may become pious], Az-Zujaaj said, “If a man knows that he’ll be killed if he murders someone, he will refrain from murder and thus both his life and that of others are preserved. [Ref 1]
Imaam Ibnul Qayyim [rahimahullaah] said: He refrains from killing out of loving and giving precedence to his own life, so there is preservation of his life and the life of the one he wants to murder. Also when a man killed another man from another family or tribe, the family or tribe of the victim killed everyone they could find from the family, tribe and city district of the murderer, and in this there was overwhelming corruption and destruction, so Allaah legislated the law of equality in punishment and so that none else is killed except the one who committed murder. This preserved the lives of murderer’s relatives and the people of his city. [Ref 2]
Imaam As-Sadi [rahimahullaah] said: By way of it [i.e. the law of equity in punishment] life is preserved and the misguided ones who exit the confines of justice are restrained. And when others witness a murderer being executed [i.e. by the government], they will take heed and refrain from the crime of murder. So, if the punishment against a murderer was other than killing him [by way of capital punishment], the evil act of murder would not have been prevented. This is the case regarding all the prescribed punishments of the Sharee’ah, because they contain a means of prevention which shows the perfect Wisdom of The All-Wise , the Oft-Forgiving. And Allaah specifically mentioned life in this Aayah as emphasis and exaltation. And when it is the case that none knows the reality of this ruling except the people of sound intellect and strong understanding, Allaah addressed them specifically. [Ref 3]
Shaikh Abdul Waahid Abu Khadeejah [hafidhahullaah] said: Some Islamic countries such as Saudi Arabia and parts of Nigeria use Sharī’ah Law as the law of the land. These include death penalties for murder and drug trafficking, and amputation and removal of a hand for thieves who steal beyond a certain considerable sum. Even though these punishments exist, they are not used often because the crime rate in many Muslim countries is low. That is for two reasons: 1. The citizens are keen to live their lives in accordance to their Islamic faith, ethics and morals. 2. The threat of these punishments serve as strong deterrent against crimes. [Ref 4]
[Ref 1: An Excerpt from Zaadul Maseer Fee Ilmit Tafseer. By Imaam Ibnul Jawzi (rahimahullaah)]
[Ref 2: An Excerpt from Miftaah Daar As-Sa’aadah 431-432. Slightly paraphrased]
[Ref 3: An Excerpt from Tafseer as-Sadi. Slightly paraphrased]