How do vaccines against HPV work?

The vaccines stimulate the immune system to produce antibodies against the HPV genotypes for which they were designed. If an individual is vaccinated before becoming infected and antibodies are produced, then the virus can not cause an infection.