The primary cause of cervical cancer is persistent infection with certain types of Human Papillomavirus (HPV). HPV is a common sexually transmitted infection, and certain strains, particularly HPV-16 and HPV-18, are known to cause the majority of cervical cancer cases. Vaginal cancer can also be associated with HPV infection, though it is rarer. Other factors include smoking, long-term use of birth control pills, and a weakened immune system.