Then, he shows the justness of his judgment: because the good will be rewarded, and so he says, And those who have done well will come forth to a resurrection of life, i.e., to living in eternal glory; but the wicked will be damned, and so he says, those who have done evil will come forth to a resurrection of judgment [i.e., condemnation], i.e., they will rise for condemnation: "These," the wicked, "will go into everlasting punishment; but the just will go to eternal life" (Mt 25:46); "Many of those who sleep in the dust of the earth will awake: some to an everlasting life, and others to everl...asting shame" (Dn 12:2).
Note that when he was speaking above of the resurrection of souls, he said, "those who hear it," the voice of the Son of God, "will live" (5:25); but here he says, will come forth. He says this because of the wicked, who will be condemned: for their life should not be called a life, but rather an eternal death. Again, above he mentioned only faith, saying, "Whoever hears my voice and believes in him who sent me, possesses eternal life; and he will not encounter judgment" (5:24). But here he mentions works, so that we do not think that faith alone, without works, is sufficient for salvation, saying: And those who have done well will come forth to a resurrection of life. As if to say: Those will come forth to a resurrection of life who do not just believe, but who have accomplished good works along with their faith: "Faith without works is dead," as we see from James (2:26).
Source: Commentary on John