How do human papillomaviruses (HPV) vaccines work?

Dr. Frank A. Spinelli, MD
Internal Medicine
There are over a hundred different subtypes of the Human Papilloma Virus (HPV). Gardasil is a vaccine that protects against subtypes 6, 11, 16 and 18. HPV subtypes 6 and 11 commonly cause genital warts, while subtypes 16 and 18 may cause cancer of the cervix, vulvar, vagina and anus. Gardasil is a recombinant vaccine, which means it utilizes genetic engineering to produce a protein found in each of the four subtypes using yeast. Therefore, you cannot get HPV from the vaccine. Gardasil is given in three separate injections over six months. Even after being vaccinated with Gardasil, routine Pap smears are still recommended.
Riverside Women's Health

The human papillomaviruses (HPV) vaccines work like other immunizations that guard against viral infection. The investigators hypothesized that the unique surface components of HPV might create an antibody response that is capable of protecting the body against infection and that these components could be used to form the basis of a vaccine. These surface components can interact with one another to form virus-like particles (VLP) that are noninfectious and stimulate the immune system to produce antibodies that can prevent the complete papillomavirus from infecting cells. They are thought to protect primarily by causing the production of antibodies that prevent infection and, consequently, the development of cervical cell changes (as seen on Pap tests) that may lead to cancer. Although these vaccines can help prevent HPV infection, they do not help eliminate existing HPV infections.

This answer is based on source information from the National Cancer Institute.