Asbāb al-nuzūl is a secondary genre of Qur'anic exegesis directed at establishing the context in which specific verses of the Qur'an were revealed. Though of some use in reconstructing the Qur'an's historicity, asbāb is by nature an exegetical rather than a historiographical genre, and as such usually associates the verses it explicates with general situations rather than specific events. A hadith recorded by Muhammad al-Bukhari which narrates the occasion of revelation of this surah is as follows.
Narrated Zayd ibn Arqam: While I was with my uncle, I heard Abd-Allah ibn Ubayy saying, "Do not spend on those who are with Allah's Messenger, that they may disperse and go away. And if we return to Medina, surely, the more honorable will expel therefrom the meaner. "I mentioned that to my uncle who, in turn, mentioned it to the Prophet. The Prophet called me and I told him about that. Then he sent for Abd-Allah ibn Ubayy and his companions, and they swore that they did not say so. The Prophet disbelieved my statement and believed theirs. I was distressed as I have never been before, and I remained in my house. My uncle said to me, "You just wanted the Prophet to consider you a liar and hate you." Then Allah revealed:-- 'When the hypocrites come to you, they say: 'We bear witness that you are indeed the Apostle of Allah." So the Prophet sent for me and recited it and said, "Allah has confirmed your statement."
Content of the surah
The Surah deals with the phenomenon of hypocrisy. It criticizes hypocrisy and condemns the hypocrites. It also exhorts the Believers to be sincere in their faith and make charity. According to Javed Ahmad Ghamidi a Pakistani Muslim theologian, Quran scholar, exegete and educationist; The theme of Surah al-Munafiqun is to inform the Muslims that the Hypocrites are absolute liars. They must not be influenced by their talk and their style of swearing oaths on every statement because they want to stop the Muslims from spending in the way of God and, in this manner, take them away from God and His Prophet. Amin Ahsan Islahi elaborates that:
The first and foremost exegesis/tafsir of the Qur'an is found in hadith of Muhammad. Although scholars including ibn Taymiyyah claim that Muhammad has commented on the whole of the Qur'an, others including Ghazali cite the limited amount of narratives, thus indicating that he has commented only on a portion of the Qur'an. Ḥadīth is literally "speech" or "report", that is a recorded saying or tradition of Muhammad validated by isnad; with Sirah Rasul Allah these comprise the sunnah and reveal shariah. According to Aishah, the life of Prophet Muhammad was practical implementation of Qur'an. Therefore, mention in hadith elevates the importance of the pertinent surah from a certain perspective.
Ibn Abi Rafi' said: Abu Hurairah led us in the Friday prayer and recited Surah Al-Jumua and "When the hypocrites come to you" in the last rak'ah. He said: I met Abu Hurairah when he finished the prayer and said to him: You recited the two surah that Ali ibn Abi Talib used to recite at Kufa. Abu Hurairah said: I heard the Messenger of Allah reciting them on Friday.