John Locke's theory starts with the most basic purposes of government and how these purposes could be best fulfilled. This approach is interesting because it truly exposes the two competing concepts that are vying with each other: freedom and safety. For any government this is the trade off that occurs. Most of the old European governments focused on the freedom of select individuals and those that serve them are provided with security, examples of this are the goverments of Feudalism and Monarchy. But if we follow the line of thought of Locke this doesn't make much sense because this one sided trade does not give any power to the people that the government is supposed to serve. A government is a form of a social contract, a group of people that trade some of their freedom to protect what remains. The security provided by a system that removes all freedom is empty for what is left to keep safe? If freedom and safety are shared by all people then a balance is acheived that fulfills government's purpose.
While this idea of a people's government is good, it alone won't work because humans are corrupt. This brings us to the idea of checks and balances. If the people do not follow the laws of their government then a judicial system provides consequences that consist of loss of one liberty or another (Property, Freedom, or even Life). If the government stops fulfilling the purpose that it was created for, then the people may rebel and replace it. These safeguards hopefully will preserve the safety and freedom of the people.