Scholars have diverse understandings about the apostasy and blasphemy. A number of scholars believe that these hadiths were issued in a specific context: in Muslim countries where the truth was shown to people, and the Prophet (s) had shown the truth to everyone. The one who openly slandered the Prophet (s) committed blasphemy and encouraged others to commit blasphemy. This threatened the religious security of those societies, and it would even lead to social disruptions. Therefore, to deter such potential outcomes, the hadiths stated that those who committed such blasphemy or apostasy were to be served capital punishment.
Such laws also have conditions. Are they to be applied in Muslim societies only, or anywhere? Are they to be applied when the truth is clearly known to everyone, or even in an era when there is so much confusion? We cannot simply take these hadiths without understanding their conditions and context. Hence, today our scholars prohibit their followers from killing a person in non-Muslim societies if they slander the holy Prophet (s). And even in Muslim societies there are conditions to be observed.