People created a government as a way of protecting themselves. According, to Locke, people created a government in order to protect their rights. He theorized that they entered a social contract in which they gave up some of their freedom to an authority (government), in exchange for protection of their remaining rights.