The wisdom behind calamities
Question

I often hear that there is great wisdom behind the calamities that befall people. What is this wisdom?.
Praise be to Allah.Yes, there is great wisdom behind calamities, including the following: 
1 – To attain true submission and servitude (‘uboodiyyah) to Allah, the Lord of the Worlds. 
Many people are slaves to their whims and desires and are not true slaves of Allah. They say that they are slaves of Allah, but when they are tested they turn on their heels and lose out in this world and in the Hereafter, and that is an evident loss. Allah says (interpretation of the meaning): 
“And among mankind is he who worships Allah as it were upon the edge (i.e. in doubt): if good befalls him, he is content therewith; but if a trial befalls him he turns back on his face (i.e. reverts to disbelief after embracing Islam). He loses both this world and the Hereafter. That is the evident loss” [al-Hajj 22:11]
2 – Trials prepare the believers to prevail on earth 
It was said to Imam al-Shaafa’i (may Allah have mercy on him): Which is better, patience or tests or prevailing? He said: Prevailing is the level attained by the Prophets, and there can be no prevailing except after trials. If a person is tried he will become patient, and if he remains patient he will prevail. 
3 – Expiation of sins
 al-Tirmidhi (2399) narrated that Abu Hurayrah (may Allah be pleased with him) said: The Prophet (peace and blessings of Allah be upon him) said: “Trials will continue to befall the believing man or woman in himself, his child and his wealth until he meets Allah with no sin on him.” Narrated by al-Tirmidhi (2399), classed as saheeh by al-Albani in al-Silsilah al-Saheehah, 2280. 
It was narrated that Anas (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) “When Allah wills good for His slave, He hastens the punishment for him in this world, and when Allah wills ill for His slave, he withholds the punishment for his sins from him his sin until he comes with all his sins on the Day of Resurrection.” Narrated by al-Tirmidhi (2396); classed as saheeh by al-Albani in al-Silsilah al-Saheehah (1220). 
4 – Attainment of reward and a rise in status 
Muslim (2572) narrated that ‘Aa’ishah (may Allah be pleased with her) said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “The believer is not harmed by a thorn or anything greater, but Allah will raise him in status thereby, or erase a sin thereby.” 
5 – Calamities provide an opportunity to think about one's faults and shortcomings and past mistakes. 
Because if it is a punishment, what was the sin? 
6 – Calamity is a lesson in Tawheed, faith and trust in Allah 
It shows you in a practical sense what you really are, so you will realize that you are a weak slave, and you have no strength and no power except with your Lord, then you will put your trust in Him in a true sense, and will turn to Him in a true sense, and put aside your position, pride, arrogance, self-admiration and heedlessness, and you will understand that you are poor and in need of your Lord, and you are weak and need to turn to the Most Strong, the Almighty,  may He be glorified. 
Ibn al-Qayyim said: 
Were it not that Allah treats His slaves with the remedy of trials and calamities, they would transgress and overstep the mark. When Allah wills good for His slaves, He gives him the medicine of calamities and trials according to his situation, so as to cure him from all fatal illnesses and diseases, until He purifies and cleanses him, and then makes him qualified for the most honourable position in this world, which is that of being a true slave of Allah (‘uboodiyyah), and for the greatest reward in the Hereafter, which is that of seeing Him and being close to Him."(Zaad al-Ma’aad, 4/195)
7 – Calamities drive out self-admiration from our hearts and bring them closer to Allah 
Ibn Hajr said: Yoonus ibn Bukayr narrated in Ziyaadaat al-Maghaazi that al-Rabee’ ibn Anas said: A man said on the day of Hunayn: “We will never be defeated today for lack of numbers.” That upset the Prophet (peace and blessings of Allah be upon him) and then they were defeated. 
Ibn al-Qayyim said in Zad al-Ma’ad (3/477): 
In His wisdom, Allah decreed that the Muslims should first taste the bitterness of defeat, despite their great numbers and adequate equipment and strength, so as to humble some people who felt proud as a result of the conquest of Makkah and who had not entered His land and His sanctuary as the Messenger of Allah (peace and blessings of Allah be upon him) had entered it, bending his head whilst riding his horse to the extent that his chin almost touched the saddle, out of humbleness before his Lord. 
Allah says (interpretation of the meaning):  
“And that Allah may test (or purify) the believers (from sins) and destroy the disbelievers” [Aal ‘Imraan 3:141]
al-Qaasimi (4/239) said: 
i.e., to cleanse them and purify them of sin and of pride and arrogance. He also cleanses them of the hypocrites, and make them stand out distinct from them… then He mentions another reason, which is “to destroy the disbelievers”, for if they prevail they will transgress and overstep the mark, which will be the cause of their downfall and destruction. The laws of Allah dictate that when He wants to destroy His enemies and erase them, he makes available to them the means which will lead to their doom and eradication, among the greatest of which, after their kufr, is their transgression and tyranny in persecuting, opposing and fighting His close friends… Allah destroyed those who waged war against the Messenger of Allah (peace and blessings of Allah be upon him) on the day of Uhud and persisted in kufr. End quote. 
8 – To demonstrate the true nature of people, for there are people whose virtue is unknown until calamity strikes 
al-Fudayl ibn ‘Iyaad said: As long as people are doing fine, their true nature is concealed, but when calamity strikes, their true natures are revealed, so the believer resorts to his faith and the hypocrite resorts to his hypocrisy.  
Al-Bayhaqi narrated in al-Dalaa’il that Abu Salamah said: Many people were confused – i.e., after the Isra’ – and some people came to Abu Bakr and told him. He said: “I bear witness that he is telling the truth.” They said: “Do you believe that he went to Syria in one night then came back to Makkah?” He said: “Yes, and I believe him in more than that, I believe what he says of the Revelation that comes to him from heaven.” And because of that he was named al-Siddeeq. 
9 – Calamities strengthen people’s resolve   
Allah chose for His Prophet (peace and blessings of Allah be upon him) a hard life filled with all kinds of hardship from a young age, in order to prepare him for the great mission that awaited him, which none could bear but the strongest of men, who have gone through hardship and who are tested with calamities and bear them with patience. 
The Prophet (peace and blessings of Allah be upon him) was born an orphan, then it was not long before his mother died too. 
Allah reminded the Prophet (peace and blessings of Allah be upon him) of that when He said (interpretation of the meaning): 
“Did He not find you O Muhammad) an orphan and give you a refuge?” [al-Duha 93:6]
It is as if Allah wanted to prepare the Prophet (peace and blessings of Allah be upon him) to bear responsibility and endure hardship from an early age. 
10 – Another reason behind calamities and hardship is that a person becomes able to distinguish between true friends and friends who only have their own interests at heart. 
11 – Calamities remind you of your sins so that you can repent from them. 
Allah says (interpretation of the meaning): 
“Whatever of good reaches you, is from Allah, but whatever of evil befalls you, is from yourself” [al-Nisa’ 4:79]
“And whatever of misfortune befalls you, it is because of what your hands have earned. And He pardons much” [al-Shoora 42:30]
Calamities offer an opportunity to repent before the greater punishment comes on the Day of Resurrection. Allah says (interpretation of the meaning): 
“And verily, We will make them taste of the near torment (i.e. the torment in the life of this world, i.e. disasters, calamities) prior to the supreme torment (in the Hereafter), in order that they may (repent and) return (i.e. accept Islam)” [al-Sajdah 32:21]
The “near torment” is hardship in this world and bad things that happen to a person. 
If life continues to be easy, a person may become conceited and arrogant, and think that he has no need of Allah, so by His mercy He tests people so that they may return to Him. 
12 – Calamities show you the true nature of this world and its transience, and that it is temporary conveniences, and shows us that true life is that which is beyond this world, in a life in which there is no sickness or exhaustion. 
“Verily, the home of the Hereafter that is the life indeed (i.e. the eternal life that will never end), if they but knew” [al-‘Ankaboot 29:64]
But this life is just hardship and exhaustion. 
“Verily, We have created man in toil” [al-Balad 90:4]
13 – Calamities remind you of the great blessings of good health and ease. 
This calamity shows you in the clearest way the meaning of health and ease that you enjoyed for many years, but did not taste their sweetness or appreciate them fully. 
Calamities remind you of blessings and the One Who bestows them, and cause you to thank and praise Allah for His blessings. 
14 – Longing for Paradise 
You will never long for Paradise until you taste the bitterness of this world. How can you long for Paradise when you are content with this world? 
This is some of the wisdom behind calamities, and the interests attained by them, and the wisdom of Allah is great indeed. 
And Allah knows best.