When does a habit become a law? Customary law tries to answer
Plenty of people do the same thing out of habit, but only some shared behaviour counts as law. Customary law is the set of practices a community treats as binding, and the tricky part is telling a rule from a routine. The philosopher H. L. A. Hart offered one test: whether breaking the pattern draws criticism people accept as fair.
A legal custom is an established pattern of behaviour in a given setting, defended as what has always been done. It becomes customary law when the people involved regard it as legally required, a belief lawyers call opinio juris. Most such law governs long-standing local community standards, though the idea also covers nearly universal international norms like the bans on piracy and slavery. Court rulings often build up around customs over time, both reinforcing them and showing how interpretation has shifted.
Much of European civil law grew from medieval custumals, collections of local custom compiled from cases in a manor or borough and eventually written down by jurists. The Coutume de Paris governed the French capital, the Sachsenspiegel northern Germany, Bracton's treatise described English custom, and Spain had its many fueros. A custumal gained the force of law once it became the undisputed rule for rights and obligations within a community.
Anthropologists have struggled to describe custom on its own terms. In Rules and Processes, John Comaroff and Simon Roberts studied Tswana law, distinguishing rules pronounced by a chief from norms that harden through use. They found the Tswana rarely sort their norms into categories and tolerate apparently contradictory ones, so disputants pick from a flexible repertoire. The complainant speaks first and frames the case; the defendant either argues within that frame or offers a rival one. John Hund objected, drawing on Hart's distinction between habits, which are purely external, and social rules, which people follow because they see them as obligatory.
Between states, customary international law arises from long patterns of conduct, peaceful or hostile, and shifts as states accept or reject new practices. Some customs, such as the prohibitions on genocide and slavery, have become peremptory norms that nothing short of an equally strong norm can override. Many treaties are attempts to write down customs that already existed.
Source: Customary law