Allah tells us that His servant and Messenger Shu`ayb (peace be upon him) warned his people, the people of Madyan, and commanded them to worship Allah Alone with no partner or associate, and to fear the wrath and punishment of Allah on the Day of Resurrection. He said:
(O my people! Worship Allah and hope for the last Day,) Ibn Jarir said: "Some of them said that this meant: Fear the Last Day.'' This is like the Ayah,
(for those who look forward to (meeting with) Allah and the Last Day) (60:6).
(and commit no mischief on the earth as mischief-makers.) This is forbidding them to make mischief on earth by spreading corruption, which means going around doing evil to people. They used to cheat in weights and measures, and ambush people on the road; this is in addition to their disbelief in Allah and His Messenger. So Allah destroyed them with a mighty earthquake that convulsed their land, and the Sayhah (shout) which tore their hearts from their bodies, and the torment of the Day of Shade, when their souls were taken. This was the torment of a great day. We have already examined their story in detail in Surat Al-A`raf, Surat Hud and Surat Ash-Shu`ara'.
(and they lay, prostrate in their dwellings.) Qatadah said, "They were dead.'' Others said that they were thrown on top of one another.
(38. And `Ad and Thamud! And indeed (their destruction) is clearly apparent to you from their (ruined) dwellings. Shaytan made their deeds fair seeming to them, and turned them away from the path, though they were intelligent.) (39. And Qarun, Fir`awn, and Haman. And indeed Musa came to them with clear Ayat, but they were arrogant in the land, yet they could not outstrip Us.) (40. So, We punished each for his sins, of them were some on whom We sent a Hasib, and of them were some who were overtaken by As-Sayhah, and of them were some whom We caused the earth to swallow, and of them were some whom We drowned. It was not Allah Who wronged them, but they wronged themselves.)
Allah tells us about these nations who disbelieved in their Messengers, and how He destroyed them and sent various kinds of punishments and vengeance upon them. `Ad, the people of Hud (peace be upon him) used to live in the Ahqaf (curved sand-hills), near Hadramawt, in the Yemen. Thamud, the people of Salih, lived in Al-Hijr, near Wadi Al-Qura. The Arabs used to know their dwelling place very well, and they often used to pass by it. Qarun was the owner of great wealth and had the keys to immense treasures. Fir`awn, the king of Egypt at the time of Musa, and his minister Haman were two Coptics who disbelieved in Allah and His Messenger, peace be upon him.
(So, We punished each for his sins,) their punishments fit their crimes.
(of them were some on whom We sent a Hasib,) This was the case with `Ad, and this happened because they said: "Who is stronger than us'' So, there came upon them a violent, intensely cold wind, which was very strong and carried pebbles which it threw upon them. It carried them through the air, lifting a man up to the sky and then hurling him headlong to the ground, so that his head split and he was left as a body without a head, like uprooted stems of date palms.
(and of them were some who were overtaken by As-Sayhah,) This is what happened to Thamud, against whom evidence was established because of the she-camel who came forth when the rock was split, exactly as they had asked for. Yet despite that they did not believe, rather they persisted in their evil behavior and disbelief, and threatening to expel Allah's Prophet Salih and the believers with him, or to stone them. So the Sayhah struck them, taking away their powers of speech and movement.
(and of them were some whom We caused the earth to swallow,) This refers to Qarun who transgressed, he was evil and arrogant. He disobeyed his Lord, the Most High, and paraded through the land in a boastful manner, filled with self-admiration, thinking that he was better than others. He showed off as he walked, so Allah caused the earth to swallow him and his house, and he will continue sinking into it until the Day of Resurrection.
(and of them were some whom We drowned.) This refers to Fir`awn, his minister Haman and their troops, all of whom were drowned in a single morning, not one of them escaped.
(It was not Allah Who wronged them,) in what He did to them,
(but they wronged themselves.) that happened to them as a punishment for what they did with their own hands.
(41. The parable of those who seek protectors from other than Allah is that of a spider who builds a house; but indeed, the weakest of houses is the spider's house -- if they but knew.) (42. Verily, Allah knows what things they invoke instead of Him. He is the All-Mighty, the All-Wise.) (43. And these are the examples We give for mankind; but none will understand them except those who have knowledge (of Allah).)
This is how Allah described the idolaters 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 besides Allah. This is unlike the Muslim believer, whose heart is devoted to Allah, 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. Then Allah warns those who worship others besides Him and associate others with Him that He knows what they do and the rivals they associate with Him. He will punish them for their attribution, for He is All-Wise and All-Knowing. Then He says:
(And these are the examples We give for mankind; but none will understand them except those who have knowledge.) meaning, no one understands them or ponders them except those who are possessed of deep knowledge. Ibn Abi Hatim recorded that `Amr bin Murrah said, "I never came across an Ayah of the Book of Allah that I did not know, but it grieved me, because I heard that Allah says:
(And these are the examples We give for mankind; but none will understand them except those who have knowledge. )''
(44. Allah created the heavens and the earth with truth. Verily, therein is surely a sign for those who believe.) (45. Recite what has been revealed to you of the Book, and perform the Salah. Verily, the Salah prevents from Al-Fahsha' (immoral sins) and Al-Munkar (evil deeds) and the remembering (praising) of Allah is greater indeed. And Allah knows what you do.) Allah tells us of His immense power, that He created the heavens and the earth with truth, meaning for a higher purpose than mere play,
(that every person may be rewarded for that which he strives) (20:15).
(that He may requite those who do evil with that which they have done, and reward those who do good, with what is best) (53:31).
(Verily, therein is surely a sign for those who believe.) meaning, there is clear evidence that Allah is alone in creating, controlling, and in His divinity.