Though surely not the first agriculturists, the Sumerians are perhaps the early developers of commercial and governmental functions. Sumeria was a collection of homesteads and villages in the south of what is now Iraq, between the Tigres and Euphrates rivers, the spectacularly fertile area of the middle east. Agriculture was the reason for settlement there. Each farmer could and did produce more than he needed for his own subsistence. Others who produced wheels or the necessary basketry or metal work could trade with the agriculturists. Sometimes there was a different value of goods or hardware involved in the trade. The Sumerians conceived of the idea of coinage to offset the difference of trade values.
Pretty soon there were disputes about the value of coinage. The elders decided to install a set of judges who could settle disputes. Someone had to have authority over the judges, and leaders were appointed. Governors or even kings. Well sometimes there were short or long term disputes or even confrontations that needed quick response to preserve a semblance of peace, the police force or its predecessor was invented and implemented.
Villages to the north coveted the villages of the south and visa versa. Oh shit! War. Armies were made by conscripting the young males. They fought as commanded or when necessary.
All this took place wa...a....ay before Moses. The Sumerians were perhaps among the first people who sought to establish a civilized, cooperative, social system. That was well before Mohammed and his Flying horse. All that was because the fertile crescent was capable of producing more crops than a single family needed.
That is a most simplistic tale of the development of a workable society that had its roots in agriculture. It does not take into account the development of the far eastern cultures in places like what is now China.