How do leaders gain the right to rule under the social contract theory?

They are elected by people.