The most recent research is saying that once your immune system clears the virus it will remain in your body and lie dormant and can remain in your cervical cells for many many years. So essentially even when your body 'clears' the virus, it is still there but not causing any damage. On rare circumstances it can cause damage and cervical cancer.
When the virus is cleared, it will not cause cell damage, and the cervical changes found on a PAP will reverse themselves in those circumstances (which is the case more often than not); but the virus is dormant and is still present in the body.
Honestly without getting too scientific, the research is still very foggy with regard to the dormancy and persistent infections. There is no definitive answer as to when a virus will go dormant in a certain person, or how long it can remain active- though it is thought that the high risk infections can remain for a very very long time. For a personal example, my Auntie was 57 when she found out she had HPV and she had been married since she was 22!
Just remember that while the virus CAN cause cell changes when active, the incidence of an HPV infection actually leading to cervical cancer, especially if you are getting regular PAPs and treating any abnormal cells, is extremely low.