The Social Contract Theory of giving up some rights for protection and safety nets from the government is the philosophy of the Enlightenment thinker Thomas Hobbes.
He thought that in the State of Nature, there is a war of men against men where the strong ones overcome the weak ones, there is no protection of any natural rights that men have. So, they established a government to prevent this eternal conflict and to protect everybody's rights.