Upon the death of Charles II without legitimate issue in February 1685, the Duke of York became king as James II in England and Ireland and James VII in Scotland.
Mary was playing cards when her husband informed her of her father's accession, and that she was heir presumptive.

When Charles's illegitimate son the Duke of Monmouth assembled an invasion force at Amsterdam, and sailed for Britain, William informed James of the Duke's departure, and ordered English regiments in the Low Countries to return to Britain.
To William's relief, Monmouth was defeated, captured and executed, but both he and Mary were dismayed by James's subsequent actions.

James had a controversial religious policy; his attempt to grant freedom of religion to non-Anglicans by suspending acts of Parliament by royal decree was not well received.
Mary considered such action illegal, and her chaplain expressed this view in a letter to the Archbishop of Canterbury, William Sancroft, on her behalf.
She was further dismayed when James refused to help when the Catholic King of France, Louis XIV, invaded Orange and persecuted Huguenot refugees there.
In an attempt to damage William, James encouraged his daughter's staff to inform her that William was having an affair with Elizabeth Villiers, the daughter of her childhood governess Frances Villiers.
Acting on the information, Mary waited outside Villiers's room and caught her husband leaving it late at night.
William denied adultery, and Mary apparently believed and forgave him.
Possibly, Villiers and William were not meeting as lovers but to exchange diplomatic intelligence.
Mary's staff was dismissed and sent back to Britain.
Upon the death of Charles II without legitimate issue in February 1685, the Duke of York became king as James II in England and Ireland and James VII in Scotland. Mary was playing cards when her husband informed her of her father's accession, and that she was heir presumptive.
When Charles's illegitimate son the Duke of Monmouth assembled an invasion force at Amsterdam, and sailed for Britain, William informed James of the Duke's departure, and ordered English regiments in the Low Countries to return to Britain. To William's relief, Monmouth was defeated, captured and executed, but both he and Mary were dismayed by James's subsequent actions.
James had a controversial religious policy; his attempt to grant freedom of religion to non-Anglicans by suspending acts of Parliament by royal decree was not well received. Mary considered such action illegal, and her chaplain expressed this view in a letter to the Archbishop of Canterbury, William Sancroft, on her behalf. She was further dismayed when James refused to help when the Catholic King of France, Louis XIV, invaded Orange and persecuted Huguenot refugees there. In an attempt to damage William, James encouraged his daughter's staff to inform her that William was having an affair with Elizabeth Villiers, the daughter of her childhood governess Frances Villiers. Acting on the information, Mary waited outside Villiers's room and caught her husband leaving it late at night. William denied adultery, and Mary apparently believed and forgave him. Possibly, Villiers and William were not meeting as lovers but to exchange diplomatic intelligence. Mary's staff was dismissed and sent back to Britain.
Mary II of England