I'm 18 and I can't get a Pap smear until I'm 21?

I went to the gyno to get a Pap smear but they told me I have to be 21 to get it so they did something else to check for stds. I don't know what the difference is between her testing me for stds or getting a Pap smear besides checking for cervical cancer.