Sophia of Hanover was born on October 14, 1630, the twelfth child of Frederick V, the Elector Palatinate and Elizabeth, the Queen of Bohemia (and James I/VI's daughter). She would provide the link between the English Stuarts and the German Hanoverians because of her marriage to Ernest Augustus, Elector of Brunswick-Lüneburg. She is pictured on the right (wikipedia source) in an Indian costume, painted by her older sister Louise). Also according to the wikipedia article:
Sophia of the Palatinate (commonly referred to as Sophia of Hanover; 14 October 1630 – 8 June 1714) was the Electress of Hanover from 1692 to 1698. She was also an heiress to the crowns of England (later Great Britain) and Ireland, countries she never visited. She was declared heiress presumptive to Queen Anne of England and Ireland by the Act of Settlement 1701, which was passed by the English parliament, and therefore only applied to the Kingdom of England (which included Wales) and the Kingdom of Ireland. A few years later, the Kingdom of Scotland agreed to accept the Hanoverian succession for the new single throne of a new country, the Kingdom of Great Britain that Scotland and England had agreed to unite as, and which came into being under the Acts of Union, 1707. Sophia, a granddaughter of James VI and I, died less than two months before she would have become queen; her claim to the thrones passed on to her eldest son, George Louis, Elector of Hanover, who ascended them as George I on 1 August 1714 Old Style.
Sophia of Hanover was chosen by Parliament in 1701 because she was the closest Stuart heir who was NOT Catholic--even her elder brother Edward's children could not succeed to the throne because they were Catholic. This Act of Succession was necessary because William and Mary had no children (and Mary was dead by 1701 and William would not remarry), and Princess Anne Stuart's only child to survive infancy, William, Duke of Gloucester, died in 1700. James II's son, James Francis Edward, considered by his supporters to be the Prince of Wales and by his detractors, the Old Pretender, were completely shut out, of course, because what had the Glorious Revolution of 1688 been for, after all! (BTW, Sophia's elder sister Louise, the artist, had also become Catholic and a Cistercian nun and abbess!)
She was opposed to her eldest son's marriage to Sophia Dorothea of Celle, even though she had arranged it! The two Sophias did not get along at all and Sophia Dorothea was unhappy in her marriage to the heir-Elector. Although she bore him two children, the future George II and Sophia Dorothea, who married Frederick William I of Prussia (and was the mother of Frederick the Great). Helen Simpson's novel, Saraband for Dead Lovers was adapted by Ealing Studios as a lovely historical movie starring Joan Greenwood and Stewart Granger, with Peter Bull as George.