Then when he says, therefore, he has mercy on whom he wills, he draws a conclusion from the two texts cited. From the statement I will have mercy upon whom I will have mercy, he concludes: therefore he has mercy upon whom he wills: the Lord has mercy on them that fear him (Ps 103:11); from the text, have I raised you, he concludes, and he hardens the heart of whomever he wills: you have hardened our heart, so that we fear you not (Isa 3:17); some of them he blessed and exalted, and some of them has he cursed and brought low (Sir 33:12).
There seems to be no difficulty about God's mercy, once w...e grant what has been said above.
But two difficulties seem to exist in regard to hardening.
First, hardening of heart seems allied to sin, as it says in Sirach: a hard heart shall fear evil at the last (Sir 3:27). Consequently, if God hardens the heart, he is the author of a sin—contrary to what is said in James: God is no tempter to evil (Jas 1:13).
The answer is that God is not said to harden anyone directly, as though he causes their malice, but indirectly, inasmuch as man makes an occasion of sin out of things God does within or outside the man; and this God himself permits. Hence, he is not said to harden as though by inserting malice, but by not affording grace.
The second difficulty is that this hardening does not seem ascribable to the divine will, since it is written: this is the will of God, your sanctification (1 Thess 4:3) and he desires all men to be saved (1 Tim 2:4).
The answer is that both mercy and justice imply a disposition of the will. Hence, just as mercy is attributed to the divine will, so also that which is just.
Therefore, the interpretation is that he has mercy on whom he wills through his mercy and he hardens whom he wills through his justice, because those whom he hardens deserve to be hardened by him, as was stated above (Rom 1).
Source: Commentary on Romans