One who is pure towards GD is identified and the man loyal in his service is recognized through his forbearance at a time when the wicked rule over him and humiliate him.
Sometimes GD bestows favor on a wicked man in order to try those who are deceptive and inwardly evil, who when they observe the prosperity of the wicked hurry to turn away from the service of GD and hasten to win the favor of the wicked and to learn from their actions. pg 393
Sometimes H'shem bestows on a wicked man favor on account of the past piety of his father in return for which it was proper to bestow benefits on the son pg 391/393
It may be that the Creator, May He be exalted, patiently bears with the wicked man until he repents and becomes worthy of his good fortune, as was the case with Menashe. pg 391
Sometimes the opportunity to obtain his livelihood without trouble and trial might be withheld from a righteous man... because of his failure to demonstrate zeal for GD's causes and exact punishment from his contemporaries. As to GD's favor bestowed on a wicked man, this sometimes happens on account of a previous good deed for which GD rewards him in this world ( so that he does not have to pay him later in the World to Come) 391