For entities as large as the state, I think there is an informal contract for people not to engage in anarchistic or revolutionary violence until their living circumstances becomes untenable. The degree to which their circumstances are understood as unjust will interact with the response they get from society.
IMO such agreements must be informal and fuzzy, and a lot of peace is maintained through these extra-legal structures.
A lot of the UK's legal system itself rests on convention, tradition, and precedent, and isn't written, and moreso going back in time as evidence of this.
Enforcement has historically sometimes taken the form of kings' heads on pikes, when the explicit law is that the king does what he wants and suffers no consequences. The implied contract of just rule takes precedence.
I think it's worth acknowledging that belief in some types of things makes them real - "self fulfilling", if you will. The social contract is one such thing, Santa Claus is another. As such, belief isn't limited to being just a mental reflection of truth - it can also be a statement of intent about what you want the world to be. When I say "I believe in you", I am not simply stating my assessment of your capabilities, I am trying to help you. It is an action. Likewise when I say "I believe in the rule of law", or "I believe causing pain is wrong" - I am trying to make them true.
https://www.goodreads.com/quotes/66591-all-right-said-susan-...