Why do hanfis consider it necessary to imprison somebody who does not pray i thought the quran states there is no compulsion in religion. Also why do malikis consider it necessary to execute such a person? Did the prophet (pbuh) ever kill someone for missing a prayer?
If someone leaves one or more of the 5 obligatory daily prayers, denying its obligation, then he is an apostate by the consensus of the scholars. The Prophet ordered the execution of apostates, except that Abu Hanifah said that this order is for men, not women, because pagan women (by consensus) are not killed in war, and she is like a pagan.
If someone leaves the prayer out of lazyness, not mockery or denial of its obligation, then there are 3 sayings among the scholars:
1. He is killed as an apostate unless he repents within 3 days. This is the saying of Ahmad due to a hadith saying that the prayer stands between the person and blasphemy. The Apostate is killed by the Prophets orders, as was related by Bukhari.
2. He is killed as a punishment, unless he repents within 3 days, but is considered to be muslim. This is the saying of Shafi3i due to the hadith that has the meaning, "I have been ordered to fight the people until they say "there is no god but Allah, and Muhammad is his Messenger." and perform the prayer, and pay zakaat..."
3. He is jailed and beaten until he repents. In other words, the punishment for not praying here falls under the general order of ordering obligations and preventing sins between muslims. This is the saying of Abu Hanifah. In this view, the hadith of the first saying means that prayer is like a barrier between the muslim and falling out of Islam, so if one leaves the prayer, then one removes that barrier and is at risk of blaspheming. The hadith of the second opinion could mean that if a group of people refuse to pray then they are fought until they repent, just like in the case of zakaat, or that what is meant is that they don't accept the obligation (so they are apostates.) This is more in agreement with another hadithin Bukhari which indicates that not muslim is killed unless he has killed unjustly, committed adultery or left Islam.
As for the saying in Quran that is often translated as "there is no compulsion in religion." This is not absolute. Rather there are 3 sayings about its meaning:
1. It was cancelled by orders to fight in surat-ut-Taubah.
2. It is for non-muslims living in muslim countries, and this is supported by a hadith mentioning that this saying was revealed regarding such people.
3. It means that the heart cannot be forced, because only Allah knows what is in the heart. We can only deal with observable matters, such as what people say and do.