The state was created when people entered into a voluntary agreement to live together (the social phase) and to establish a government (the political phase).
Social Contract Theory.