This is from an OME lecture.
Cervical cancer starts with an HPV infection that gets out of control and is not adequately suppressed. Normal immune systems or vaccination are adequate to suppress/eliminate HPV infection. Smoking and other STIs are typically considered as risk factors for developing cervical cancer. So the HPV infection is necessary but in and of itself is not sufficient to cause cervical cancer. Smoking impairs the immune system, making it more difficult to clear an HPV infection. Similarly, having other STIs does not make it more difficult to clear an HPV infection but makes it statistically more likely to come into contact with HPV more often, which increases the likelihood of HPV not being cleared and developing into cervical cancer.