The short and obvious answer is:
Oaths work because religion.
If you believe that God punishes oathbreakers with, let's say, a infinity of torment in the next world, then there's really no incentive for any rational person ever to break an oath.
Serendipitously, just yesterday I discovered this blog which goes crazy in depth on a lot of "fantasy-antiquity" tropes. Come for the siege of Gondor, stay for "Oaths: How do They Work?":
In most of modern life, we have drained much of the meaning out of the few oaths that we still take, in part because we tend to be very secular and so don’t regularly consider the religious aspects of the oaths – even for people who are themselves religious. Consider it this way: when someone lies in court on a TV show, we think, “ooh, he’s going to get in trouble with the law for perjury.” We do not generally think, “Ah yes, this man’s soul will burn in hell for all eternity, for he has literally damned himself.” ...
So when thinking about oaths, we want to think about them the way people in the past did: as things that work – that is they do something. In particular, we should understand these oaths as effective – by which I mean that the oath itself actually does something more than just the words alone. 674
They trigger some actual, functional supernatural mechanisms. In essence, we want to treat these oaths as real in order to understand them.
If your premodern civilization really cannot spare a god or two to witness oaths, then the next best thing would be for them to set up the closest possible facsimile to an omniscient, omnipotent witness — somebody who
* sees when an oath is taken
* sees, with infallible accuracy, when an oath is broken
* harshly punishes the oathbreaker
and, pretty importantly,
* is never witnessed to have failed in their two capacities as omniscient-observer-of-oathbreakings and omnipotent-punisher-of-oathbreakers
because if people start getting the idea that they might not be punished for breaking their oath, well, then all bets are off, and you'd better invent lawyers quick.
What'd be perfect is if you can manage to inflict your harsh punishment only in the afterlife, and nobody ever comes back from the afterlife to falsify your claim of infallibility. (Again, if your culture hasn't got an afterlife, you'll have to invent some facsimile. Unfortunately I'm having a hard time imagining what that might look like.) 209