In 1648 the 30 Years War was ended with the Treaty of Westphalia, also known as the Great Peace of Westphalia, which changed the order of how Nation States were viewed. The older order of States revolved around the Imperial State or the Monarchical State, which was ordered from the top downwards by an over-arching authority. Prior to the Imperial State or that of the Monarchy there were other Nation State forms: the City State and the Republican State, with varieties of cooperation types for both (federations, confederations, oligopolies, etc.). Additionally for internal ruling the variances within States were wide, from authoritarian sole leaders with a cadre of sub-leaders to rule over the State to representative democracies to direct democracies to indirect representational democracies to theocratic non-elected. Imperial States gathered in multiple other States and imposed a uniform rule from the top, usually via acquisition (purchase or military) of the smaller State units. For the larger part of man's history, since the beginning of the written record, there has been an Imperial or top-down form of rule over mankind for that period which goes to Ancient Sumer, Babylon, Egypt and the smaller entities in China and India as well as in North and South America, all the way to the present day with China, Saudi Arabia, Syria, Venezuela, North Korea, Burma and other Nation States imposing authoritarian or totalitarian rule from the top.
In Europe the Treaty of Westphalia would set a clear dividing line between the Imperial State and the Sovereign Nation State as entities, and exclude the latter from being acceptable to creating a peaceful civilization. This was done to separate the religion of the rulers of Nation States from the religion of the people in those States. During the 30 Years War many Principalities and even Nations changed sides, switched religions and then forced obedience to the new religious form or forced exile or execution upon those who would not conform. This was done under sub-types of Christianity: Roman Catholicism, Lutheranism, Calvinism. The State's religious stance was separated from interfering with the religious stance of the people of the State and would, via that disconnection, allow freedom of worship amongst those three religious sub-types in the signatory States. This is not 'separation of church and state' but an individual freedom from the State's religion and freedom of worship is recognized as an individual liberty to exercise your right to worship as you choose.
While many Ancient States might recognize an individual as having such rights and liberties, the Treaty of Westphalia set this religious freedom and respect of it as a touchstone of civilization: without such recognition of individual rights and liberties the State would be free to force a moral order upon individuals without their consent. This would set up a type of State rarely seen before, and put in place the order between Nation States that would then come from that Treaty: the Secular State. The Secular State can function with a religion, that is not prohibited. The Secular State is to respect the religious beliefs of the people of the State and is to function in a way that is neutral to them by not imposing religious requirements, mandates and teachings into their churches. Thus laws must be compatible with the religious beliefs of the people of the State and not impose a religious moral order within their churches nor mandate adherence to the State's religion.
From this the Sovereign Nation State is seen as having rule over the temporal territory on Earth, with its own religious outlook, but takes the civil means to make laws that are amenable to all citizens and infringe on the religious beliefs of none of them. Prior to this much of the outlook of Imperial States or Monarchical States, and even some Republics, was that the State was all-powerful in the temporal domain of life. This is the beginning of the disentanglement of the State as sovereign entity from being an all-powerful temporal construct and to it being a limited construct that must be fully in accord with the personal rights and liberties of its people. The Ancients had started this work, of course, but through the Dark Ages (not only of Rome but of Greece before it) the meaning of that understanding had become side-lined, even though it was an intrinsic part of daily life for all mankind. If Westphalia is the first major instantiation that codifies this limitation by Treaty, then it is the ability for Nations to sign Treaties and have them be respected that points to the underlying understanding that pre-existed it.
Humans, when we form into a cooperative group called a 'family' creates the first bonds of civilization which are those of self-restraint. Nature gives all creatures abilities and as part of Natural Law all creatures have the entire suite of positive and negative rights and liberties given to them. The rights are absolute and cannot be taken from any creature, and all have those rights from the smallest to the largest, to exercise as their will. Liberty, that utilization of rights, is voluntary and must be put forward as an active proposition so that the right can be exercised. When one is free to use all of their rights they are an animal and exist in the savage state of Nature and under Natural Law. When we choose not to use our Natural Rights so as to protect others from our own savage nature, we create civil activity, civil understanding and create the basis for the Nation.
While each creature is a sovereign animal it is in community, in consciously putting some Natural Rights aside for the safety of our fellows that allows us to create the sovereign nation as an entity in our cooperative understanding of the society we have created. From this we build government to house our negative Natural Liberties and utilize them on our behalf under our common watch as they are too dangerous for society for each of us to exercise on our own. As these negative Natural Liberties accumulate, the power of our agreement for them to be used on our behalf creates a structure that would also allow it to be used against us as these are negative Natural Liberties, after all, not positive ones. We create a positive moral climate in our agreement not to use these Natural Rights, as individuals, government does not create any positive moral climate and, in its function can only be a punisher of crimes upon those who seek to destroy or corrode that morality: government upholds no morality, but punishes the immorality of individuals. As such government is a necessary evil as allowing ourselves to become savages in our activities is no good at all, but it in no way is an instrument of perfecting our selves, it is only good in that it protects us from others.
As this moves up in the size of governments, we get to the size where one government is in contact with another, and these are sovereign entities designed to protect us by holding our negative Natural Liberties in common. In the creation of this entity of government to hold our animal attached negative Natural Liberties, we do a task that is common to all peoples of earth and, indeed, any who are civilized. From this we can see that civilization has universal requirements on the formation of a civil society via the individuals within it agreeing not to wield their full suite of positive and negative Natural Rights and only utilize their positive Natural Liberties for the benefit of themselves, their family, their society and their Nation. When two created holders of our negative Natural Liberties meet there can be a wide array of interactions: they can be agreeable to each other, they can be disagreeable to each other as their societies are different, they can fight each other by utilizing the negative Natural Liberty of war and empowering citizens to form up in war against this other sovereign Nation. At the end of this contact there will be final agreement, no matter if it is peaceful cooperation, agreed-upon indifference, or the final cessation of hostilities by victory, defeat or stalemate. How these Nations get along must be available to all of those we call citizens in both Nations and this is done through this thing we call a Treaty. Each and every Treaty done by a sovereign nation commits the individuals within that society to that Treaty, and yet the people can enjoin their government to dissolve such Treaties when they are injurious to society or contrary to the positive moral climate of the nation.
There is no written law about how these things work, and yet it is common to all mankind that forms society at the lowest of levels. From the Ancients we came to realize that this unwritten law could be defined, its outlines given and how Nations worked circumscribed and delineated. This magnum work of Nations and how they come about and work is call the Law of Nations and it covers all Nations from the very earliest created to the most modern as the creation of Nations is for the same function across all time. This is a Universal Law that is unwritten. It is created by creatures seeking to consciously put aside their use of negative Natural Liberties to create a civil atmosphere and society, thus it is not pre-ordained in any way save by that common urge for community. From this we can say that all creatures, indeed all beings, who seek to create civil society are beholden to the unwritten Law of Nations as it is the result of creation for a given end: it is the means to an end and the only way to construct civil society is via this means.
If our Nation is created via our ability to self-govern and withhold our use of our negative Natural Rights, then Westphalia is the first instance in which a non-martial agreement to withhold the use of the negative Natural Liberty invested in the Nation is performed: the negative Natural Liberty to impose religion by force against one's own people is held in abeyance by those Nations and all individuals in those Nations coming under that Treaty. This destructive negative Natural Liberty is agreed upon, by Treaty, amongst Nations as being too awful to utilize in any way, shape or form upon any citizen within their territories. This formulation of Treaty is also universal to its holders and timeless: once you sign up for it, then it holds to all parts of your territory unless the action is taken to walk away from it and in any event once you fall under it you will continue to be under it until the end of your days. Nothing like it has been seen before or since it was created. It has been expanded upon to a concept of the universal recognition of the necessity for individuals to choose their own religion, beyond those three sects within Christianity, but that is only done in those Nations that put that forward for their own people. Westphalia endures via the function of religious tolerance by the Nation State and the people within it who uphold the Treaty in their daily lives.
Attempts to found other human rights via Treaty have not fared as well, as nothing is as primal as one's own spiritual belief and their view of how they fit in creation and Nature. Even those who disdain a belief in the Divine are coming to terms with that in their own way, and in those Nations where this most civil of concepts rules, they are given that leeway for good and ill because to do otherwise is now recognized as injurious and uncivilized. We can still witness the brutal repression of those Nations that enforce a single religion or doctrine upon their people, be it deistic or communistic, and there is no good at all to be had via that route and it is a signal point of human suffering when it is performed. This does not mean that religion is divorced from the secular Nation, quite the contrary as a common agreement on what must be punished in the way of actions must be upheld widely across a Nation so that laws can be made to protect the moral climate.
These laws do not create a moral climate, for if they did we would have easily gotten one by this point in our history if they had the power to do so as the immoral would recognize their punishment and change their ways. Quite the contrary happens as laws punish those seeking to degrade the common morality, thus laws are a punitive function, not a positive function of society. The positive function, that of atonement, is not given to the punisher, but to those willing to work with the punished to show them a better way for their lives to work in harmony with their fellow man in society. That is why outreach programs by religious institutions have shown success in helping those who wish to reform to do so, and even in convincing those who have not thought through their actions to do so and then seek a better life. Secular institutions have some success in the former, little in the latter, as they cannot assert a positive moral climate as that is not their function. Helping those seeking to atone to do so is relatively easy, asking those who have not examined their lives requires far more than punitive capacity or directing the willing to suitable help: it requires showing, demonstrating and living in a positive moral way that then shows how a good life can be had without threatening one's fellow man.
Thusly a treaty that posits self-restraint for a Nation and for oneself can only operate if the moral climate is such that it is a demonstrable necessity to do so. With as much as 20% of Europe dead just due to the 30 Years War, not including plagues and such, the proof was available for all to see: religious authority vested in the secular Nation came to no good end at all. The self-restraint of governments to agree to not do this had to have a firm foundation in the peoples they represented, and that was available only after the horror of the 30 Years War. Even the Second World War did not see such a high percentage of a regional population dead, and that is counting the gas chambers, civil prison work camps, starvation due to loss of agriculture, mass bombings, nuclear devices, destruction of cities by airpower and ground power, and even having to draft children to fight for one of the Nations involved: none of that was equivalent to the religious wars in the form of pure loss of life from the totality of local populations across so many Nations. The 'never again' at the end of WWII against genocide did not stop Mao or Pol Pot or Stalin from slaughtering millions more of their own people after the war. Nor did it stop even small actors like Saddam Hussein from doing so.
Indeed the post-war institutions of the 20th century can be seen as serial failures when compared to the enduring success of the Great Peace of Westphalia. Apparently our revulsion of genocide of minority populations was not enough to stem the tide of hatred that sets man against man due to differences in ethnicity, society, culture, and wealth. And for those societies outside of Westphalia the practice of religious intolerance and religious slaughter continues to this day. As we are no longer taught the meaning of Westphalia we lose sight of its purpose and the positive value for creation that is self-restraint. Since we cannot teach religious tolerance and respect, we are now losing it, yet again, and no laws by government can uphold a faltering positive moral climate when the people of the Nation no longer uphold it themselves. No amount of rules, no amount of punishment can do that. Only individuals can do that.
Civilization starts with you.