Sure Aal-i-Imraan

3:141

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

Und damit Allah diejenigen, die glauben, herausstellt und die Ungläubigen dahinschwinden läßt.

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.