Then when he says for we know, he discloses and commends God's judgment. And concerning this he does three things. First, he declares the truth of God's judgment; second, he rejects a contrary opinion, at do you think this; third, he manifests the truth, at who will render (Rom 2:6).
First, therefore, he says: the reason I say that you condemn yourself, when you do the same things that you judge, is that we know, i.e., we hold it as certain, that the judgment of God is against those who do such things, i.e., God's judgment threatens them: the avenger of sin is the sword, that you may know the...re is a judgment (Job 19:29); God will bring every deed into judgment (Eccl 12:14).
We also know that this judgment will be according to truth: he will judge the earth with justice (Ps 96:13).
But man's judgment, even though it be formed justly, is not always based on the truth of the affair, but on the words of witnesses, which sometimes clash with the truth. But this cannot happen in the divine judgment, because, as is said: I am the judge and witness (Jer 21:23). Nor is he deceived by false allegations: I will not spare him, nor his mighty words, and framed to make supplication (Job 41:12).
Source: Commentary on Romans