"bond money, security given to obtain the release of a prisoner," late 15c., a sense that apparently developed from that of "temporary release (of an arrested person) from jail" (into the custody of another, who gives security for future appearance at trial), which is recorded from early 15c. That seems to have evolved from the earlier meanings "captivity, custody" (late 14c.), "charge, guardianship" (early 14c.).
The word is from Old French baillier "to control, to guard, deliver" (12c.), from Latin baiulare "to bear a burden," from baiulus "porter, carrier, one who bears burdens (for pay)," which is of uncertain origin; perhaps a borrowing from Germanic and cognate with the root of English pack, or perhaps from Celtic. De Vaan writes that, in either case, "PIE origin seems unlikely."
To go to(or in) bail "be released on bail" is attested from mid-15c. In late 18c. criminal slang, to give leg bail meant "to run away."
"to dip water out of," 1610s, from baile (n.) "small wooden bucket" (mid-14c.), from nautical Old French baille "bucket, pail," from Medieval Latin *baiula (aquae), literally "porter of water," from Latin baiulare "to bear a burden" (see bail (n.1)).
To bail out "leave suddenly" (intransitive) is recorded from 1930, originally of airplane pilots. Perhaps there is some influence from bail (v.2) "procure (someone's) release from prison." Related: Bailed; bailing.
"horizontal piece of wood in a cricket wicket," c. 1742, originally "a cross bar" of any sort (1570s), probably identical with French bail "horizontal piece of wood affixed on two stakes," and with English bail "palisade wall, outer wall of a castle" (see bailey). From 1904 as the hinged bar which holds the paper against the platen of a typewriter.
"to procure someone's release from arrest or imprisonment" (by posting bail), 1580s, from bail (n.1); usually with out. Related: Bailed; bailing.