Fair to whom?
It was fair in some sense, for example, it re-payed with murder for murder.
However, sometimes it was also unfair, for example if a builder made a house that caused someone's son to die, that builder's son would be put to death: this was not fair to the builder's son, who did not do anything!
also it was not fair to all people, as slaves had less rights as free people.