I'm currently reading Juan Cole's new book on Muhammad and I got to the part about the Treaty of Hudaibiya and the fact that the pagans and the Muslims are arguing over the exact words to be written in the treaty. What significance did writing have to a mostly illiterate people like that? It's not as if there was a third party guarantor that either the Muslims or the pagans could've taken the document to. So what was the actual utility (social, cultural, etc) in crafting a written treaty as opposed to an oral agreement?
Let's go back to the beginning as a way to explain what written treaties meant to powers before the modern era.
The oldest extant written treaty was formed between Ramses II of Egypt and Hattusilis III of the Hittite Empire, c. 1259 BC. Copies both of the Hittite and Egyptian versions have been found, and it is clear that this was a multilateral treaty, made among peers rather than any sort of master/subject relationship. It ended a long period of conflict between the two empires, during which they had fought to control the area around modern-day Syria. This treaty is sometimes called The Treaty of Kadesh, after the well-documented chariot battle that had occurred sixteen years earlier- a battle after which both sides had left the field claiming victory. (Ramses II- according to his own chroniclers- led a decisive counter-attack at the critical point of the battle and forced the Hittites to retreat, but was unable to complete his campaign objective of capturing Kadesh due to the casualties taken by his army).
The treaty involved three primary agreements. First, of course, the two powers would henceforth be at peace. Second, the two powers entered into a defensive alliance, and pledged to help each other when called, against both foreign foes and domestic rebellions. Third, they agreed to a treaty of extradition.
As OP notes, there is a risk in having no third party guarantor of the treaty- it's not like Shang dynasty China would come over to punish anyone for breaking it! These were very much the two premier powers of the region at that time- they could only appeal to their gods as guarantors, and they did- "As for these words which are on this tablet of silver of the land of Hatti and of the land of Egypt- as for him who shall not keep them, a thousand gods of the land of Hatti, together with a thousand gods of the land of Egypt, shall destroy his house, his lands, and his servants." This is a pretty serious oath, to say that not only your gods but also the gods of your rival should feel free to strike you down if you break it. But diplomacy can't function solely on the basis of religion, and that is why this treaty intentionally went beyond that of a simple cease fire.
The fact that it was written and had detailed agreements, allows both parties to know for certain exactly when the the treaty has been broken- even before anyone gets invaded. This is why we might use the phrase that "diplomacy is breaking down" between two powers- smaller breaches of trust are likely to occur before larger ones. If the Hittites refused an Egyptian call for military aid, if the Egyptians harbored Hittite dissidents, etc. these would have been obvious signs that the peace could be coming to an end. Thus aggression on the part of the aggrieved party would be easier to justify (and, though more so in modern cases, such breaches make a state appear less trustworthy in general- thus other powers would be less likely to treat with them).
And there's even a happy ending here, sort of. This oldest treaty of history was never broken. Ramses II later married a Hittite princess and the two sides coexisted peacefully for the next century (until the Hittite Empire collapsed).