Additionally, the role that law plays in the society is to guarantee the rights of those who are weaker either physically or socially in any given social structure. It is clearly impossible for everybody in any society to have absolute freedom: as one person may want to exercise that freedom, it would trample upon somebody else's freedom. So, the laws put limits on each person's freedom in order to protect other person's freedom. For example: we are free to drive a car on the road, but only if we possess a valid driving license and even then, we must keep to one side of the road, and also obey to the speed limits and road signs. In this way, although our freedom to drive is restricted, we are protected from other people's careless or unskilled driving.
Laws are therefore enacted by elected representatives of the social group to protect the rights of life and substance from those in a society who would use their prestige, wealth and manipulation of arms to restrict the rights of others. Laws are written to be followed and applied equally to all people in a given society to ensure that no one feels abused by his fellow countrymen and to protect members of society from each other.
The other reasons for having laws in society is because it plays many functions such as ensuring government power is being recognised, promoting personal freedom, facilitating planning , the realization of reasonable expectations, promoting economic growth through free competition, promoting social justice, and protecting the environment as well. Additionally, laws are generally based on a set of ethics accepted by society. In the case if someone does something society considers morally wrong, it is generally considered to be wrong by the law too.
In concluding, it is said that without laws, the society would be at the mercy of anarchists whose main mission is to disrupt the orderly progress of a society and then everyone would be living in a chaotic and uncertain world. So, the fundamental aim of having laws in society is therefore to create social cohesion or harmony.