Old English ordel, ordal, "trial by physical test," literally "judgment, verdict," from Proto-Germanic noun *uz-dailjam "a portioning out, judgment" (source also of Old Saxon urdeli, Old Frisian urdel, Dutch oordeel, German urteil "judgment"), literally "that which is dealt out" (by the gods), from *uzdailijan "to share out," related to Old English adælan "to deal out," from *uz‑ "out" + PIE *dail- "to divide," Northern Indo-European extended form of root *da- "to divide." Curiously absent in Middle English, and perhaps reborrowed 16c. from Medieval Latin or Middle French, which got it from Germanic.
The notion is of the kind of arduous physical test (such as walking blindfolded and barefoot between red-hot plowshares) that was believed to determine a person's guilt or innocence by immediate judgment of the deity, an ancient Teutonic mode of trial. English retains a more exact sense of the word; its cognates in German, etc., have been generalized.
Metaphoric extension to "anything which tests character or endurance" is attested from 1650s. The prefix or- survives in English only in this word, but was common in Old English and other Germanic languages (Gothic ur-, Old Norse or-, etc.) and originally was an adverb and preposition meaning "out."