Why do we pray for those in Purgatory?

My understanding of purgatory is that it is meant to purify us before we are allowed to enter into God’s presence, since nothing impure can enter Heaven. Depending on our situation in life, each of us will have more or less earthly attachments to be purged of before we are finished with purgatory. So, when I pray a prayer for holy souls to be released from purgatory, how does it affect them? If no-one can enter Heaven until they are fully purified, why would I pray for them to be released early?

These links should be helpful for understanding the Catholic Church’s teachings on praying for the dead. If you have any further questions or concerns that are not answered by these links, please contact Catholic Answers directly.
Recommended Reading:
]* The Roots of Purgatory**
]* If the souls in purgatory are destined for heaven, why do we pray for them?**

DISCLAIMER: The views and opinions expressed in these forums do not necessarily reflect those of Catholic Answers. For official apologetics resources please visit www.catholic.com.