"perplex or embarrass by suddenly exciting the conscience, discomfit, make ashamed," late 14c., earlier "lose one's composure, be upset" (early 14c.), from Old French esbaiss-, present stem of esbaer "lose one's composure, be startled, be stunned."
Originally, to put to confusion from any strong emotion, whether of fear, of wonder, shame, or admiration, but restricted in modern times to effect of shame. [Hensleigh Wedgwood, "A Dictionary of English Etymology," 1859]
The first element is es "out" (from Latin ex; see ex-). The second may be ba(y)er "to be open, gape" (if the notion is "gaping with astonishment"), possibly ultimately imitative of opening the lips. Middle English Compendium also compares Old French abaissier "bow, diminish, lower oneself" (source of abase). Related: Abashed; abashing. Bashful is a 16c. derivative.