There is no universal definition of law in science, but the general meaning of this term is clear to everyone. In a generalized form, law can be represented as a set of certain rules governing social relations. Therefore, the reasons for the emergence of law must be sought in the very structure of society.
The process of the emergence and formation of law took place in close connection with the process of the emergence and formation of society itself. The formation of human thinking, a person’s awareness of his own individuality and uniqueness, the accumulation of knowledge about the external and internal world - all this led to a significant complication of the structure of relations between people. And in order to regulate these relations, a new social mechanism was needed that has no analogues in the animal kingdom. This mechanism has become law. It is believed that morality was the forerunner of law. In the modern view, morality is defined as a set of norms and rules adopted in society and regulating human actions. Awareness of the concepts of good, evil, conscience, honor, justice, duty, mercy and others significantly increased the vitality of the whole society. It was in this period of history that we can say that human society has ceased to be a pack. An important step was the realization of the main right of every person - the right to life, without which all other rights lose all meaning. But morality covered only the moral component of public life, being only one of the mechanisms of public control, but not management. Effective management required norms established not by society itself, but by their leaders. And the first sources for such norms were customs. By custom is meant an action rooted in society through repeated repetition. The first historically recorded form of custom was taboo. The taboo was a ban imposed by the priest and binding on any member of the community. The first universally recognized taboo is the ban on incest, which has significantly improved the human gene pool. Leaders and priests possessed power, and, therefore, the ability to establish customs. The rule, initially expressed in custom, then became the law. Further complication of the social structure also led to the complication of the legal apparatus of society. New public and legal institutions began to appear and develop, the evolution of which continues to this day. Having emerged as a means of regulating social and human relations, law has become an integral part of the existence of society.