From Pope St. John Paul II’s Apostolic Exhortation Reconciliatio et Pænitentia (1984):
The second conviction concerns the function of the sacrament of penance for those who have recourse to it. According to the most ancient traditional idea, the sacrament is a kind of judicial action; but this takes place before a tribunal of mercy rather than of strict and rigorous justice, which is comparable to human tribunals only by analogy namely insofar as sinners reveal their sins and their condition as creatures subject to sin; they commit themselves to renouncing and combating sin; accept the punishment (sacramental penance) which the confessor imposes on them and receive absolution from him.
But as it reflects on the function of this sacrament, the church’s consciousness discerns in it, over and above the character of judgment in the sense just mentioned, a healing of a medicinal character. And this is linked to the fact that the Gospel frequently presents Christ as healer,179 while his redemptive work is often called, from Christian antiquity, medicina salutis. “I wish to heal, not accuse,” St. Augustine said, referring to the exercise of the pastoral activity regarding penance,180 and it is thanks to the medicine of confession that the experience of sin does not degenerate into despair.181 The Rite of Penance alludes to this healing aspect of the sacrament,182 to which modern man is perhaps more sensitive, seeing as he does in sin the element of error but even more the element of weakness and human frailty.
Whether as a tribunal of mercy or a place of spiritual healing, under both aspects the sacrament requires a knowledge of the sinner’s heart in order to be able to judge and absolve, to cure and heal. Precisely for this reason the sacrament involves on the part of the penitent a sincere and complete confession of sins. This therefore has a raison d’être not only inspired by ascetical purposes (as an exercise of humility and mortification), but one that is inherent in the very nature of the sacrament.
179 Cf Lk 5:31f: “Those who are well have no need of a physician, but those who are sick” concluding: “I have . . . come to call . . . sinners to repentance”; Lk 9:2: “And he sent them out to preach the kingdom of God and to heal.” The image of Christ the physician takes on new and striking elements if we compare it with the figure of the Servant of Yahweh, of whom the Book of Isaiah prophesies that “he has borne our griefs and carried our sorrows” and that “with his stripes we are healed” (Is 53:4f).
180 St. Augustine, Sermo 82, 8: Patrologiæ Cursus completus, Series Latina [PL] 38, 511.
181 Ibid., Sermo 352, 3, 8:9: PL 39, 1558f.
182 Cf Ordo Pænitentiæ, 6c.
— Reconciliatio et Pænitentia 30