And she (Maryam) who guarded her chastity. We breathed in her some of Our Spirit and made her and her son a Sign for all the worlds. (Surat al-Anbiya: 91)
One of the incidents with which Allah tested the people of Maryam is the birth of Jesus (as). This birth, which was an unusual event for people, was a test both for Maryam and her people. In reality, the way Jesus (as) was born was a miracle Allah employed to summon people to true faith and one of the most explicit evidences of the existence of Allah. Yet, her people failed to grasp it and were suspicious:
She brought him to her people, carrying him. They said, "Maryam! You have done an unthinkable thing! Sister of Harun (Aaron), your father was not an evil man nor was your mother an unchaste woman!" (Surah Maryam: 27-28)
As explained in the verses above, upon Maryam's return from the distant place with Jesus (as), her people did not let her make an explanation. They assumed that Maryam had done an indecent and shocking deed, and simply slandered her in an ugly manner. However, those who spread these slanders about Maryam knew her almost from the day she was born and were aware of her purity and piety (taqwa), like the other members of the family of ‘Imran.
Surely, these accusations and slanders were a test for Maryam. It was apparent that a person, so pure and pious, would not act as alleged. This was only a test for Maryam. From the time Maryam was born, Allah always helped her and turned everything she did to good. Maryam, in return, knew that every incident happens by the Will of Allah and only Allah could prove the groundless nature of these slanders.
Indeed, Allah provided comfort to Maryam and inspired her to remain quiet. Allah instructed her not to speak with her people but to point to Jesus (as), if they ever approached her and attempted to make accusations. This way, Maryam avoided any trouble such a discussion was likely to create. The one who would provide the most accurate answers to the people was Jesus (as). When Allah gave the good tidings of the birth of Jesus (as) to Maryam, He also informed her that he would speak clearly while he was still in his cradle: