She was taken prisoner by a group of bandits and rescued by the First Doctor. He brought her into his TARDIS. However, when he was about to let her leave, he was surrounded by knights. Not knowing their intentions, he shut her into the TARDIS and faced them himself.
The knights belonged to her brother, and they were afraid of his magical powers. They threatened to kill him, but he got the Fifth Doctor to help him. The Fifth Doctor convinced one of the knights, Henry, to enter the TARDIS and see that Mary was safe. She was in the TARDIS, and Henry brought her to their brother, letting the Doctor go. (PROSE: Five Card Draw)