James II's flight in 1688 had given Parliament the opportunity to alter the succession to the English throne and to elect a King. Having once used this power to offer the throne to William and Mary, Parliament was not hesitant in exercising its influence over the succession again.
Apart from enacting as statute the rights of the subject, the 1689 Bill of Rights legislated that the succession to the throne would pass first to any children of James II's two daughters Mary and Anne before going to any children born to William by a second marriage. Furthermore, it stated that Catholics or those married to Catholics could not succeed to the throne.
The Protestant Succession
There was little concern in 1689 that the Protestant Succession was in danger, but there was unease when Queen Mary died in December 1694 without leaving any children.
This turned to great concern when the Duke of Gloucester, the only surviving child of Princess Anne, died aged 11 in July 1700. This left Anne's half-brother James, the infant whose birth in June 1688 had spurred William of Orange to invade, Anne's successor.
The Hanover connection
In June 1701 Parliament hoped to resolve this problem by passing the Act of Settlement. It confirmed the provision of the Bill of Rights that no Catholic or person with a Catholic spouse could sit on the throne.
The Act also legislated that, to preserve the Protestant Succession in case neither Anne nor William had any more children, the Crown would pass at Anne's death to a Protestant relation. This was Sophia, the electress of Hanover in Germany, the granddaughter of James I by his daughter Elizabeth, and first cousin to Charles II and James II.
Sophia's son George I succeeded to the throne upon Anne's death in 1714, and his descendants, including the current Queen, have ruled Britain ever since - all because of a decision of Parliament in 1701 to alter the succession and to choose its own monarch.