[3:141] And that God may prove the believers, and efface the disbelievers.
The tests of the Unseen are a kind of smelting for the servant. Through different stages, He purifies him from faults so that he becomes like pure gold without any dross. In this way, one becomes clear of defects and purified for God.
And efface the disbelievers in the wadis of dispersion (tafriqa). As for the scum, it passes away as dross [13:17].