Regarding the timing and contextual background of the revelation (asbāb al-nuzūl), it is a "Meccan surah", which means it is believed to have beenrevealed in Mecca, instead of later in Medina. It was revealed around 2-3 years beforeHijrah, in a later stage ofMuhammad preaching inMecca.
The surah states thatNuh,Ibrahim,Lut,Shuaib,Hud,Saleh,Musa andMuhammad all were prophets of God and endured hardships. For example, Noah was ridiculed often, and Abraham was thrown into the fire. But God destroyed their people who transgressed. Verse 40 says
So each We punished for his sin; of them was he on whom We sent down a violent storm, and of them was he whom the rumbling overtook, and of them was he whom We made to be swallowed up by the earth, and of them was he whom We drowned; and it did not beseem Allah that He should be unjust to them, but they were unjust to their own souls.[2]
The parable of those who take protectors other than God is that of a spider spinning a shelter. And the flimsiest of all shelters is certainly that of a spider, if only they knew.
Mustafa Khattab, author of theClear Quran, notes that "Externally, the web is too flimsy to protect the spider against rain and strong wind. Internally, the spider’s family structure is fragile, since some species are cannibalistic, with the female preying on the male and the young eating their own mother."[5]
"This is howAllah described the idolators in their reverence of gods besides Him, hoping that they would help them and provide for them, and turning to them in times of difficulties. In this regard, they were like the house of a spider, which is so weak and frail, because by clinging to these gods they were like a person who holds on to a spider's web, who does not gain any benefit from that. If they knew this, they would not take any protectors besidesAllah. This is unlike theMuslim believer, whose heart is devoted toAllah, yet he still does righteous deeds and follows the Laws of Allah, for he has grasped the most trustworthy handle that will never break because it is so strong and firm."
^Wherry, Elwood Morris (1896).A Complete Index toSale's Text, Preliminary Discourse, and Notes. London: Kegan Paul, Trench, Trubner, and Co. This article incorporates text from this source, which is in thepublic domain.