"His eyes see, his eyelids test the sons of man. For whom does he test? He tests the righteous, as it is said, 'The Lord tests the righteous' (Psalms 11:5). Why does he not test the wicked?

Because they cannot withstand it, as it is said, 'But the wicked are like the tossing sea, which cannot rest' (Isaiah 57:20). Rabbi Yosei bar Hanina said: This flax plant, when it is coarse, if one exerts too much pressure upon it, it snaps. But when it is fine, one may exert great pressure upon it for whatever purpose it is desired, and it will not snap. So too, the Holy One, blessed be He, does not test the wicked, who cannot withstand it, but He does test the righteous, as it is said, 'The Lord tests the righteous.' But the wicked and one who loves violence His soul hates." (Talmud Bavli, Berachot 5a)