The social contract is a theory developed during the Enlighment period, specially by the philosopher Rousseau regarding the legitimacy of those who exercise power over others.
At that time, this concept arose against absolut monarchies and the extended belief about kings who obtained their power directly from God. Alternatively, the social contract theory proposed that power lied in the people and could be granted by them to a ruler. Hence, legitimate goverments are appointed by citizens and a sort of "contract" is established between the rulers and the governed ones.
A society is constructed by people through agreements, instead of just naturally granted by God. There has been a rupture with people blindly beliving in religious dogmas, substituted by critical behaviours directed by the Reason and scientific thinking.