Like many of the shorter surahs, the surah of the unbelievers takes the form of an invocation, telling the reader something they must ask for or say aloud. Here, the passage asks one to keep in mind the separation between belief and unbelief both in the past and the present, ending with the often cited line "To you your religion, and to me mine". Although some view this as an argument against religious intolerance, others see it as a more time-specific revelation, warning the newly founded Muslim minority in Mecca against being induced to collude with disbelievers. It was revealed in Mecca when the Muslims were persecuted by the polytheists of Mecca.
Cause of revelation
"Wahb bin Munabbih has related that the people of Quraish said to Allah's' Messenger: 'If you like we would enter your faith for a year and you would enter our faith for a year.'". "...In this way, if what you have brought us is better than what we have, we would partake of it and take our share of goodness from it; and if what we have is better than what you have brought, you would partake of it and take your share of goodness from it."
Hadith
As for the esteem in which Muhammad held this surah, it can be judged from the following few hadith:
Abdullah ibn Umar has related that on many an occasions he heard Muhammad recite Surahs Qul Ya- ayyuhal- kafirun and Qul Huwu-Allahu ahad in the two rakats before the Fajr obligatory prayer and in the two rakats after the Maghrib obligatory prayer.
Khabbab ibn al-Aratt says: "The Holy Prophet said to me: when you lie downin bed to sleep, recite Qul ya-ayyuhal kafirun, and this was the Holy Prophet's own practice also; when he lay down to sleep, he recited this Surah."
According to Ibn Abbas, Muhammad said to the people: "Should I tell you the word which will protect you from polytheism? It is that you should recite Qul ya-ayyuhal kafirun when you go to bed."
Anas says that Muhammad said to Mu'adh bin Jabal; "Recite Qul ya-ayyuhal-kafirun at the time you go to bed, for this is immunity from polytheism."
Both Fardah bin Naufal and Abdur Rahman bin Naufal have stated that their father, Naufal bin Muawiyah al-Ashjai, said to Muhammad: "Teach me something which I may recite at the time I go to bed." Muhammad replied: "Recite Qul ya-ayyuhal kafirun to the end and then sleep, for this is immunity from polytheism." A similar request was made by Jabalah bin Harithah, brother of Said bin Harithah, to Muhammad and to him also he gave the same reply.
Muhammad recited in the two rakahs before the morning prayer and the two rakahs after the sunset prayer on ten or twenty different occasions: Say O' al-Kafirun and say He is God, the One.