Question about cervical cancer?

i just got the shot (one less! :P) and i understand what and where the cervics is, but how do you get cervical cancer? do you get cervical cancer from having sex? if so then why did i get this shot at thirteen?
4 answers 4