Regarding the old “Trial by…” methods: our ancestors were not fools and seemingly bizarre or destructive methods of trial would not have lasted through long periods unless they served some function or other. One possibility is that where accused wrongdoers rightly or wrongly believed in the efficacy of a truth-finding ordeal, they would signal their belief in their guilt (by confessing) or not and that was the real information yielded by the process, making it unnecessary to follow through with the menaced injury.
According to this article, for example, there is reason to believe the supposedly boiling water in the boiling-water ordeal had been allowed to cool substantially, turning it into more of a psychological than a physical challenge. [Peter Leeson, Aeon]
There is also a literature worth checking out on the similarities to the old trials by ordeal (or outright torture) of our own current plea bargain system.