The above answer is incorrect in suggesting that people agree to give up some of their freedoms in order to have the government protect their truly important freedoms. This was the philosophy of Thomas Hobbes, who argued that unless this was done, life would be "nasty, brutish and short." Nowhere in the Declaration or in the philosophy upon which it is based, is it suggested that people must surrender ANY rights in order to secure others. In fact, Hobbes theory was used to justify the Divine Rights of Kings, which has no bearing in the Declaration--quite the contrary.
The Declaration was based almost entirely on Thomas Jefferson's understanding of John Locke's vision of the Social Contract as expressed in Locke's Second Treatise on Government. A comparison of the two is illustrative:
A. Locke: All men are born with certain "natural rights." Among them are life, liberty and property.
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.
B. Locke: Pursuant to the Social Contract, governments are created for the sole purpose of protecting one's natural rights:
That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed.
C. Locke: People have the right to change their form of government if they believe it no longer protects their natural rights. Locke used this argument originally to justify the Glorious Revolution of 1688, in which James II was deposed and the throne offered to William and Mary.
That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.
The social contract is the idea that people get together and agree to give up some of their freedoms in order to have the government protect their truly important freedoms. This idea is strongly reflected in the Declaration of Independence. The Declaration says that governments derive their legitimacy from the consent of the governed. This corresponds to the idea that people agree to be governed. The Declaration also says that the government needs to protect people's rights to life, liberty, and the pursuit of happiness. This corresponds to the idea that the government has to protect the people's important freedoms. In this way, the Declaration very clearly upholds the idea of the social contract.