For He said to Moses [Ex. 33:19], “I will show pity to whomever I want, and I will show mercy to whomever I want.”
So then, it does not depend on what a person wants or does, but on God, who shows pity [i.e., to whomever He wants].