Margaret returned from exile in 1605. She had been in exile since 1571, when she was forced to flee from Scotland to England after being accused of treason by her half-brother, King James VI. In 1603, James VI inherited the English throne and became King James I of England. He pardoned Margaret and allowed her to return to Scotland.
The Enchanting Reign of Margaret of Valois: How Well Do You Know the Queen Consort of France?