Punishment
Question :

How do we explain the punishments imposed by the Sharia for various crimes, such as the death penalty for apostates, while the Quran says that there is no compulsion in religion?

Answer :

Applying the Sharia-defined punishments is the duty of the Prophet and the Imams (peace be upon them). No doubt, applying them is a form of justice and not an oppressive act. The punishment is set in the Sharia after the evidence is established and becomes clear in such a way that the noncompliant is considered as an oppressor against himself and the society. As such, the Sharia-defined punishment is not considered against human rights.
The verse alluded to refers to the fact that the religion is based on beliefs, and beliefs are not imposed, and does not indicate that there is no punishment imposed by the Sharia for disbelief out of stubbornness and transgression.