Sura Aal-i-Imraan

3:141

وَلِيُمَحِّصَ ٱللَّهُ ٱلَّذِينَ ءَامَنُوا۟ وَيَمْحَقَ ٱلْكَٰفِرِينَ

och för att sätta de troende på prov och låta förnekarna av sanningen gå under.

Tafsir 3:141

A part of this wisdom of changing fortunes is the purification of those who have faith from their sins, separating them from the hypocrites, and destroying and removing those who reject the truth.