Queen Anne became Queen of England after King William III died.

King William III – who preceded Queen Anne on the throne. Following his death in 1702, Anne took over as queen. Born on 6 February 1665, Anne was the daughter of James II and therefore one of the only remaining Stuarts following the Dutch takeover.

Source