The historical background of the 1700s I'm a bit vague on, but it was crucial for the development of Parliamentary government in the UK through a long series of succession crises from the civil war onwards that only really ended with the childless death of the younger Charles Stuart in 1788.
Essentially there were two incompatible criteria for English monarchs to be publicly accepted: "not Catholic" and "not foreign".