Warts are the most common std
chances are your girlfriend has had them for years only they did not "grow" until the pregnancy
she could have gotten them from any previous sexual partner and not known until much later...As could you
as for how they got to your rectal area, usually anal sex is the way they spread, if you haven't been the "receiver" of anal, then maybe from a "rim job" is the best bet, or maybe your skin got exposed to your girlfrind's vagina. It is also possible for baby's to catch warts from the mother's birth canal, but usually they have them in the throat area..
So those are my best guesses
almost every woman who is not a virgin gets exposed to genital warts, so it does not mean your girlfriend is slutting around or anything
the warts can "hide" in the vaginal tissue, though, even if there are no "polyps" visible on the outside, and put the female at risk for cervical cancer, so your girlfriend should get regular pap smears to check for that
also, if you want them to go away, your doctor or a skin specialist can "burn" them off with a chemical--it hurts like a health forum, tho', I won't lie to you, I had it done...
Burning them off does not "cure" them, though, they can come back
there is a potential "cure" with interferon therapy--you can find out more about it on other websites probably, like web md. I had it done and it was so worth it--mine are gone and never came back. You are given shots of interferon to stimulate your immune system to attack and kill off the virus that causes the warts. You feel kind of sick, like the flu for the two or three days after the injections-which are once a month by the way--
for about 6 months. I don't know the success rate--but it worked for me.
Hope this helps