Penance is a special virtue not merely because it sorrows for evil done (since charity would suffice for that), but also because the penitent grieves for the sin he has committed, inasmuch as it is an offense against God, and purposes to amend. Now amendment for an offense committed against anyone is not made by merely ceasing to offend, but it is necessary to make some kind of compensation, which obtains in offenses committed against another, just as retribution does, only that compensation is on the part of the offender, as when he makes satisfaction, whereas retribution is on the part of the person offended against. Each of these belongs to the matter of justice, because each is a kind of commutation. Wherefore it is evident that penance, as a virtue, is a part of justice.
It must be observed, however, that according to the Philosopher (Ethic. v, 6) a thing is said to be just in two ways, simply and relatively. A thing is just simply when it is between equals, since justice is a kind of equality, and he calls this the politic or civil just, because all citizens are equal, in the point of being immediately under the ruler, retaining their freedom. But a thing is just relatively when it is between parties of whom one is subject to the other, as a servant under his master, a son under his father, a wife under her husband. It is this kind of just that we consider in penance. Wherefore the penitent has recourse to God with a purpose of amendment, as a servant to his master, according to Psalm 122:2: "Behold, as the eyes of servants are on the hands of their masters . . . so are our eyes unto the Lord our God, until He have mercy on us"; and as a son to his father, according to Luke 15:21: "Father, I have sinned against heaven and before thee"; and as a wife to her husband, according to Jeremiah 3:1: "Thou hast prostituted thyself to many lovers; nevertheless return to Me, saith the Lord."
St. Thomas Aquinas, Summa Theologiae 3.85.3