The idea that a society can systematically take charge of the various relations within that society through the establishment of a body of conceptually developed laws is one that has evolved over time. Early forms of societal organisation had no specific need for, nor concept of, a codified legal system. Decisions were made based on the need or circumstances involved, and the pressures exerted on and by those who exercised influence in that society. Over time, of course, certain things became generally codified as the way a particular society addressed matters that came up repeatedly.
Sri Aurobindo observes the process: “At first, in the early stage of society, there is no such thing as what we understand by law…; there are only a mass of binding habits … determined by the inner nature of the group-man and according to the action upon it of the forces and the necessities of his environment. They become instituta, things that acquire a fixed and formal status, institutions, and crystallise into laws. Moreover, they embrace the whole life of the society; there is no distinction between the political and administrative, the social and the religious law; these not only all meet in one system, but run inextricably into and are determined by each other. … This complex customary law evolved indeed, but by a natural development of the body of social habits in obedience to changing ideas and more and more complex necessities. There was no single and fixed legislative authority to determine them by conscious shaping and selection or in anticipation of popular consent or by direct ideative action upon the general consensus of need and opinion. Kings and prophets and Rishis and Brahmin jurists might exercise such an action according to their power and influence, but none of these were the constituted legislative sovereign; the king in India was the administrator of the Dharma and not at all or only exceptionally and to a hardly noticeable extent the legislator.”
Sri Aurobindo, The Ideal of Human Unity, Part Two, Chapter 20, The Drive towards Economic Centralisation, pp. 176-177