This can be traced back to social contract theory
"In political philosophy the social contract or political contract is a theory or model, originating during the Age of Enlightenment, that typically addresses the questions of the origin of society and the legitimacy of the authority of the state over the individual.[1] Social contract arguments typically posit that individuals have consented, either explicitly or tacitly, to surrender some of their freedoms and submit to the authority of the ruler or magistrate (or to the decision of a majority), in exchange for protection of their remaining rights. The question of the relation between natural and legal rights, therefore, is often an aspect of social contract theory"
Social contract - Wikipedia, the free encyclopedia
"Locke's political theory was founded on social contract theory. Unlike Thomas Hobbes, Locke believed that human nature is characterised by reason and tolerance. Like Hobbes, Locke believed that human nature allowed men to be selfish. This is apparent with the introduction of currency. In a natural state all people were equal and independent, and everyone had a natural right to defend his “Life, health, Liberty, or Possessions".[21] Most scholars trace the phrase, "life, liberty, and the pursuit of happiness,"
in the American Declaration of Independence to Locke's theory of rights,[22] though other origins have been suggested"
John Locke - Wikipedia, the free encyclopedia
Paul