Gardasil works by stimulating the immune system to produce antibodies against HPV. The vaccine targets multiple strains of the virus, including HPV types 6, 11, 16, and 18. Types 16 and 18 are responsible for approximately 70% of cervical cancer cases, while types 6 and 11 cause about 90% of genital warts cases.