In Surah Roum Allaah Ta'ala says,
41. Corruption has appeared on land and at sea because of the deeds of man and so that Allaah may let them taste (the consequences) of some of their deeds, so that they may refrain.
42. Say, “Travel in the lands and see what was the plight of those before. Most of them were polytheists.”
43. So focus your attention on the upright religion before a day comes when there will be no defence against Allaah. On that day people will be separated.
44. Whoever disbelieves, his disbelief will be to his detriment. Whoever carries out a good deed, such people will be preparing the ground for themselves…
45. …so that Allaah may reward those who believe and do good deeds from His grace. Without doubt, Allaah does not like the disbelievers.
Allaah has granted man the option to do good and evil deeds so that He may test them. Man is exposed to elements both within himself and from outside which tempt him to be disobedient to Allaah’s commands. However, Allaah has sent the Ambiya (A.S) to guide man in the right direction and warn him about the consequences of his deeds. One of these consequences is that anarchy and strife begin to reign on earth. It is with reference to this that Allaah says, “Corruption has appeared on land and at sea because of the deeds of man…”
The “corruption” mentioned in this verse refers to all types of adversities like widespread murder, epidemics, drought, cyclones, earthquakes, etc. Allaah afflicts man with all these adversities so that he may take heed and mend his ways when he realises that these calamities are a result of his sins. Allaah refers to this when He says, “so that Allaah may let them taste (the consequences) of some of their deeds, so that they may refrain.”
Allaah does not punish man for all his sins, but for some of them, as the verse denotes. Allaah says in Surah Faatir, “If Allaah were to take man to task for everything he does, Allaah would not have left a single creature on the face of the earth. But Allaah defers them until an appointed term.” [Surah 35, verse 45]
A verse of Surah Shura reads: “The adversities that afflict you are a result of the deeds you earn, and Allaah pardons a great deal.” [Surah 42, verse 30]
The corruption that sins may cause on land are evident. With regard to one of the ill effects of sin on the sea, Hadhrat Abdullaah bin Abbaas (R.A) mentions that oysters open their mouths when rain falls at sea. A raindrop in the oyster’s mouth causes a precious pearl to form. When man sins, Allaah stops the rains falling, because of which man is deprived of pearls. “Ruhul Ma’aani” reports from Hadhrat Mujaahid (A.R) that the negative effect of sins causes tyrannical rulers to snatch away the marine vessels of the poor. There are many other examples of pirating and shipwrecks, which are all a result of sins.
When Allaah’s punishment descends on account of man’s sins, not even the pious and the animals are spared. Hadhrat Abu Hurayra (R.A) once overheard a person saying that an oppressor harms only himself by his sins. Hadhrat Abu Hurayra (R.A) said, “This is not so. All the other creation also suffer because of him, to the extent that a bustard bird can die of starvation because of the oppression of a tyrant.” [“Mishkaat” Pg. 432]
When droughts are caused by sins, man and animal suffer from the scarcity of water and food. It should be noted that the verse does not refer to the sufferings that pious people suffer. Allaah afflicts them with difficulties so that He may elevate their positions and forgive them. Adversities are a blessing for such people because their patience will earn them immense rewards from Allaah.
“Say, ‘Travel in the lands and see what was the plight of those before. Most of them were polytheists.’” These people were annihilated by Allaah’s punishment because they refused to believe in Tauheed. People are urged to visit the ruins of their cities and take lesson from it. The phrase “Most of them were polytheists” denotes that there were others among them who perpetrated other types of kufr as well, but the most destructive sin is that of shirk (polytheism).
“So focus your attention on the upright religion (i.e. belief in Tauheed) before a day (Qiyaamah) comes to you in which there will be no defence against (the punishment of) Allaah. On that day people will be separated.” Those who were good will be separated from the evildoers.
Describing the difference of people, Allaah says, “Whoever disbelieves, his disbelief will be to his detriment. Whoever carries out a good deed, such people will be preparing the ground for themselves so that Allaah may reward those who believe and do good deeds from His grace. Without doubt, Allaah does not like the disbelievers.” Allaah loves only those people who have Imaan, and will reward them in both worlds for their good deeds.
Anwarul Bayan Surah Roum, Verse 41-45
Further information and discussion on the verses : http://ilmhub.com/general-discussion/(tafseer)-we-are-the-architect-of-our-own-destruction/msg1034/#msg1034