Born to Frederick V of the Palatinate, a member of the House of Wittelsbach, and Elizabeth Stuart, in 1630, Sophia grew up in the Dutch Republic, where her family had sought refuge after the sequestration of their Electorate during the Thirty Years' War. Sophia's brother Charles Louis was restored to the Lower Palatinate as part of the Peace of Westphalia. Sophia married Ernest Augustus of Brunswick-Lüneburg in 1658. Despite his temper and frequent absences, Sophia loved him, and bore him seven children who survived to adulthood. Initially a landless cadet, Ernest Augustus succeeded in having the House of Hanover raised to electoral dignity in 1692. Therefore, Sophia became Electress of Hanover, the title by which she is best remembered. A patron of the arts, Sophia commissioned Herrenhausen Palace its gardens and sponsored philosophers, such as Gottfried Leibniz and John Toland.