That he (+Josph) knew her not till she bore a Child. This could be interpreted that Jospeh did not have sexual relations with Mary until after she had a child, or -- as we understand -- up to the point when she conceived and had a Child -- i.e. asserting her virginity. But we assume that sexual relations did not exist after the Birth because there is nothing in the NT that asserts that they did or didn't.
We know she was a virgin when she said to the angel that she knows "not a man." Besides, she was bethroded to +Jospeh, and people did not, as a matter of habit, have pre-marital sex in those days because it was something she could have died for.
Now, what is troubling is that the Apostles specifically assert her virginity prior to Conception and Birth, but remain ambiguous as to what might have happened afterwards.
They simply don't say anything because the focus of the canonical scripture is Christ and not Mary.
The answer is -- nothing. Mary was in need of a Savior as much as anyone, as Harley referenced.
An excellent book is "The Cult of the Virgin Mary: Psychological Origins" by Michael P. Carroll. Carroll draws clear comparisons between the veneration of Mary and the pagan worship of the goddess Cybele.