And the sea gave up its dead, and death and hell gave up the dead who were in them; and each was judged according to their deeds.
Now he returns to what he had passed over. For the general resurrection will take place first, and afterward judgment will be carried out. The Lord makes this clear in the Gospel, saying to his disciples: “At the renewal of all things, when the Son of Man sits on his glorious throne, you also will sit on twelve thrones, judging the twelve tribes of Israel” (Matt. 19:28). He first mentioned the renewal of all things, that is, the resurrection; then he said that they... would sit to judge the peoples. And in the Gospel of this John, the Lord says: “The hour is coming when all who are in the tombs will hear the voice of the Son of God, and those who have done good will come out to the resurrection of life, while those who have done evil will come out to the resurrection of judgment” (Jn. 5:28–29). At the Lord’s command, therefore, the dead will come out of their tombs, because the bodies of all the dead, brought to life through the reception of their souls, will emerge from their graves. Those who have done evil will come out to the resurrection of judgment, because they will rise for this purpose: to be judged in the very bodies in which their souls sinned, so that those who were partners in their wickedness may share in their torments. The present passage also shows that the resurrection will take place before the judgment, since it says that after the dead have been given up by the sea, death, and hell [infernum], the wicked will be judged. The Catholic faith, which we often recite, likewise makes this clear when it says of the Lord: “At whose coming all people must rise with their bodies and give an account of their own deeds” (Athanasian Creed).
We must inquire what are meant by death, the sea, and hell. For we know that waters have been consecrated for the cleansing of our sins, as the Lord says in the Gospel: “Unless someone is born again of water and the Holy Spirit, he cannot enter the kingdom of God” (Jn. 3:5). The sea, therefore, refers to the resurrection of the elect, while death and hell pertain to the wicked. Therefore, in this passage, the sea signifies baptism. The sea will, as it were, give up its dead when the elect, who received in baptism the purity in which they will also rise, do so without any stain of sin. The sea will give up its dead because the washing of holy baptism and the grace of the Holy Spirit will present all the elect, at the time of the resurrection, pure and clean before their Creator. By death we can understand the bodies of the wicked, held dead in the depths of the earth; and by hell, their souls, since they are confined in hell’s prison. Hell, then, will give up its dead, because it will send back the souls it holds, devoured by the first death, to receive their own bodies. Death, too, will give up its dead, because it will present the bodies it had reduced to dust, so that by divine power they may be brought to life through the reception of their souls.
Source: Commentary on Revelation