The means of any forgiveness is penance. The following is taken from the Catechism of the Catholic Church:
ARTICLE 4: THE SACRAMENT OF PENANCE AND RECONCILIATION
1422 Those who approach the sacrament of Penance obtain pardon from God's mercy for the offense committed against him, and are, at the same time, reconciled with the Church which they have wounded by their sins and which by charity, by example, and by prayer labors for their conversion.
Aquinas notes the following:
Punishment is proportionate to sin. Now sin comprises two things. First, there is the turning away from the immutable good, which is infinite, wherefore, in this respect, sin is infinite. Secondly, there is the inordinate turning to mutable good. In this respect sin is finite, both because the mutable good itself is finite, and because the movement of turning towards it is finite, since the acts of a creature cannot be infinite. Accordingly, in so far as sin consists in turning away from something, its corresponding punishment is the "pain of loss," which also is infinite, because it is the loss of the infinite good, i.e. God. But in so far as sin turns inordinately to something, its corresponding punishment is the "pain of sense," which is also finite.
When man sins mortally, they enact a debt both infinite and finite (if they commit venial sins, they enact only the latter). The infinite debt for our sins has the opportunity to be overlooked in the penance Christ offers for original sin. But the finite punishment is still existent, and even necessary in the process of attaining salvation. The finite punishment is still relevant to the human condition, and through Christ's penance, it is made to be satisfactory in nature (meaning the finite punishment can achieve merits as founded in the perfect and primary merits Christ achieved through His own penance on the cross). The finite punishment, as far as it is satisfactory, and thus voluntary, is a specific type of penance, the other being confession.
So believing in Christ, which includes confession, is certainly the primary means of penance, but the other half consists of a different kind of penance, namely the willingness to go through finite punishment in order to discipline and reshape the fallen finite aspect of our will. The fullness of our will, in other words, even after asking for forgiveness, is still subject to sin and its tendencies. Though we ask for forgiveness, we are still imperfect creatures, not in a judicial sense, but in a practical sense. Thus is it that although we can be justified solely in perfect contrition or more commonly in the forgiveness achieved through the priesthood from God, further penance is required for our will to be fully aligned to God, which is itself salvation. And thus is it that Catholics firmly assert purgatory is not a place/process of opportunity for any souls to gain the 'judicial ticket' of entering heaven which can only be gained by believing in Christ on earth, but rather is a process in which the aspects of the imperfect soul becomes cleansed 'as through fire' before entering heaven (1 Corinthians 3:15). Purgatory is a process for the already elected Church; it is not a process for those who are not of the elect at the moment of death. It is a process for the elected Church (those with no unforgiven mortal sins) to have purged their unforgiven venial sins through finite punishment. So the Catechism states:
ARTICLE 12: "I BELIEVE IN LIFE EVERLASTING"
1022 Each man receives his eternal retribution in his immortal soul at the very moment of his death, in a particular judgment that refers his life to Christ: either entrance into the blessedness of heaven-through a purification or immediately,-- or immediate and everlasting damnation
1030 All who die in God's grace and friendship, but still imperfectly purified, are indeed assured of their eternal salvation; but after death they undergo purification, so as to achieve the holiness necessary to enter the joy of heaven.
1031 The Church gives the name Purgatory to this final purification of the elect, which is entirely different from the punishment of the damned. The Church formulated her doctrine of faith on Purgatory especially at the Councils of Florence and Trent. The tradition of the Church, by reference to certain texts of Scripture, speaks of a cleansing fire.
The idea that it is necessary for souls to go through finite punishment consists in an understanding of the nature of sin and what is truly meant by 'punishment'. In sinning, man offends God by not offering all of the obedience that is rightly due to God. So, while infinite punishment has no opportunity of being satisfactory because it is involuntarily gone through, finite punishment does have the opportunity of being satisfactory, both because of the penance of Christ and because souls can willingly choose to enter it. This still doesn't address why the punishment itself gains merits. And the point here is to realize that 'punishment' in its most basic sense is actually the satisfaction made for a debt of sin, which robs God of the obedience He is owed. In short, 'punishment' is simply a thing that engenders greater obedience. Think about a court case. Let's say a man has committed a crime that at least deserves a minimal retribution, but which also deserves prison in life. If the man deemed guilty of this crime enters his punishment willingly, he is thus complying to the will of the judge himself, and to some degree making his own satisfaction. Of course, the ultimate end of being locked in the jailhouse forever can only be justly prevented if there is one who makes full satisfaction for the man's debts, which the guilty himself cannot do. For in entering the punishment of imprisonment for life, the man can gain nothing of it for himself, since he shall in no case be freed. Thus satosfaction cannot be made for his own life through himself, where satosfaction could be made for his own life if he were free. So one who is perfect and greater than the law itself must make satisfaction for the guilty. So a benefactor who decides to take mercy on the guilty man pays for his release at the cost of his own luxury. But the man guilty of breaking the law can still offer something, and indeed must offer something, if he is to share in the satisfaction made for him through his benefactor. If he doesn't, than he refuses to partake in the same spirit that is of the satisfaction made for him, and so he is still condemned by his own doing. The guilty man must go through rehabilitation and actually allow this sacrifice to change his own behavior and tendencies. He must go through the minimal punishment that he is actually able to go through to make satisfaction as a productive and free man. If not, than he is not offering the full obedience thay is owed to God, and so defeating the very purpose for which he was freed from the fate of prison. This analogy is meant to display the nature of Christ and the nature of the penance we must offer in light of Christ's sacrifice. Just like the guilty lawbreaker, if we do not offer whatever we can in our own way and turn away from our sins, than we are not fully in union with God. This entire process is what is going on in penance, both in confession and in finite punishment. Confession is the admitting of our faults and recognizing the sacrifice made for us, while finite punishment is the going through rehabilitation and adjusting our behavior in order that the entirety of our will is made righteous, which is what is owed to our benefactor.
So the answer is both basic and complicated. The souls have been forgiven of mortal sins that are in purgatory (hence their existence in purgatory rather than in hell). They are not going through a means of 'forgiveness', which is only one form of penance (the more primary, albeit), but are going through another form of penance just as necessary for the attainment of salvation; finite punishment. It is this punishment that is necessary for the means of amending the debts of venial and otherwise imperfect tendencies. Christ did not abolish finite punishment for the believer as he did eternal punishment; he allowed it the opportunity of being satisfactory. It is this satisfactory punishment that souls in purgatory go through in order to achieve the merit of perfection, not in judicial terms (which is achieved through Christ), but in active terms (which is existent within the free, independent will of the person).