Pelvic exam

When a doctor does a pelvic exam for a bacteria infection or a yeast infection. And then has to stick two fingers in to feel the top and ask u if u feel pain.. What are they assuming?