According to Locke what happens when government does not uphold the social contract between the people and the government

According to John Locke, when the government fails to uphold the social contract between the people and the government, the people have the right to rebel and replace that government with one that is more adequate in fulfilling its obligations.

Locke believed in a limited government, where its primary purpose was to protect the natural rights of the individuals, including life, liberty, and property. The social contract between the people and the government was an agreement that individuals willingly entered into to form a society with a governing body.

However, if the government violates this social contract by infringing upon or neglecting the natural rights of the people, then according to Locke, the people have the right to dissolve that government and establish a new one. He argued that it is the duty of the citizens to rebel against an unjust, tyrannical government and replace it with a just and legitimate one. In Locke's view, this right to revolution is a fundamental natural right that individuals possess.

Locke's ideas had a significant influence on later political thinkers and played a crucial role in the development of democratic states, as they provided a philosophical basis for the right to rebel against oppressive governments.