The second part of Dante's Divine Comedy, Purgatory depicts the middle part of Dante's journey from the Inferno to Paradise, taking place primarily on Mount Purgatory. This middle step between Hell and Heaven both bridges the gap of Dante's journey and serves as a large-scale allegory of salvation: through the grace of God, man may leave his former state of sin and death (Inferno) and, by process of sanctification (Purgatorio), may enter the Kingdom of God (Paradiso).
At the entrance to Purgatory is the gatekeeper Cato, a former pagan Roman statesman who had a reputation for honesty and being a stickler for the rules. At first glance, it seems odd that he would be allowed access to Purgatory since he did not have the single necessary element: faith in Christ. However, God (in Dante's fictional rendering) extends grace to him since he decided to commit suicide rather than give up his freedom to tyranny. His devotion to freedom and justice made him an excellent choice to guard the entrance to Purgatory.
After passing through Ante-Purgatory, Dante travels through the seven terraces of sin, beginning with the first (Pride) and ascending to the seventh (Lust). Interestingly, this is a reversal of the levels of Inferno, where Lust was only the second circle. This inversion corresponds to Dante's worldbuilding: supposedly, when Satan fell to Earth, he plowed into the ground, creating the Inferno (hence his presence in the ninth circle of Hell) and simultaneously creating Mount Purgatory on the other side of the world by causing all that dirt to be displaced and pushed outward. As Dante ascends through each terrace, seeing examples of the sins and antidotes to the sins, angels remove P's (representing sin, from the Italian "peccatum") from his forehead one by one until he emerges from the seventh terrace with a clean slate. He then continues to ascend until Virgil leaves him, to be replaced with Dante's childhood love and Muse, Beatrice.
The ascension of the soul from Purgatory to Paradise is the main theme here; Purgatory is not a final destination for anyone (except Cato, probably). As such, the poem seems to be constantly looking upward, striving to reach Paradise rather than dwelling on the path. It's masterfully done, and by the time Dante and the reader reach the Earthly Paradise, punishment has been completed and only Paradise remains, paralleling the journey of the Christian from depravity to holiness.