Divine trial is an unchangeable and constant divine tradition. God tries all humans at all times. Therefore the prophets and divine authorities are not only exempted from this rule, their trial is harder. Because God afflicts those who are beloved are closer to Him with harsher tests. Let us review the mysteries of divine trial.
According to verses and narrations related to affliction, it seems that God afflicts people with harsh trials for several reasons including:
Education and evolution of man. The everlasting law and tradition of God requires man to be put through trials in order to develop his hidden talents and therefore educate them. Man is put through the furnace of hardships to become more resilient just as iron is smelt to become steel. Testing man by hardships is a means to perfect and purge soul in order to purify his essence. Hardships and difficulties train and strengthen the soul. Manâ€™s essence cannot flourish unless under hardships.
If there are no difficulty and hardship, man will be corrupted. God says, â€œWe have certainly created man into hardship.â€â€Œ (Al-Balad: 4). In order to find the life he deserves, man must bear the difficulties and hardships. Difficulties and hardships are whips that drive the evolution of all beings and particularly men. In his letter to his governor in Basra, Uthman ibn Hunayf al-Ansari, Imam Ali says: living in comfort and avoiding hardships causes weakness and living with hardships makes man powerful and agile and strengthen his essence. In part of the letter he says, â€œRemember that desert tree have very strong timber while green twigs have soft bark, and the wild bushes burn brighter and longer.â€â€Œ 
Qurâ€™an says in reference to this motive for divine trials that, â€œ[It was] so that Allah might test what is in your breasts and purify what is in your hearts. And Allah knows of that within the breasts.â€â€Œ (Al-e Imran: 154)
 . Behar al-Anwar. Vol. 78, P 194
 . Nahjul-Balagha, letter 4