Br. Dawood peace and greetings.
The mother of Hazrat Mariam [ra] at the time of dedicating her to the service of the temple, prayed for her protection from shaitan and her off springs too.
Did Allah inspired to her mother that Hazrat Mariam [ra] will give birth to a child bypassing His law. Or she knew that at certain age she has to leave the temple and will marry, that is the reason she prayed for her off springs.
A virgin birth can lead to variety of imaginative tales.
I highly recommend to download the following book by Ahmadiya [Lahore Group ] and go thru pages 147 thru 185. In the Light of Holy Quran.