The growth of villages in ancient Mesopotamia must have led to contention, between men, for land and irrigation needs. Quite likely first they fought with each other. Over time they must have banded together in bigger groups to fend off attackers or manage food growth.
One physical result is the town, mud-walled at first to keep out floods and enemies, raised above water on a platform. It was logical for the local deity’s shrine to be the place chosen: he stood behind the community’s authority. It would be exercised by his chief priest, who became ruler of the little theocracy competing with others.
It is not clear to me why civilization emerged in Sumer. These people had contacts with other similar Neolithic cultures of Anatolia, Assyria and Iran, but only in Sumer did all the factors come together to create our first known civilization.