From Old French 'baillier' (to hand over, to deliver) — bail is the act of delivering a prisoner into the custody of sureties who guarantee their return for trial.
The temporary release of an accused person awaiting trial, sometimes on condition that a sum of money is lodged to guarantee their appearance in court; the sum of money so pledged.
From Old French baillier (to deliver, to hand over, to entrust, to have charge of), from Latin bāiulāre (to carry a burden, to bear, to transport), from bāiulus (a porter, a carrier, one who bears loads for hire — a common figure in ancient Roman streets). The PIE root behind bāiulus is uncertain and debated; it may connect to *bher- (to carry, to bear), the highly productive root that gave English bear, birth, burden, fertile, and transfer. The legal sense of bail developed from the central act of bailing: the prisoner was delivered — handed
The nautical term 'bail' (to scoop water from a boat) and the legal term 'bail' (to release on surety) share the same French ancestor 'baillier' (to hand over, to deliver). Bailing out a boat means delivering the water out of it; bailing out a prisoner means delivering them from custody into the care of a surety.