From the condition of a hunted animal comes the transferred sense of "final encounter," and thence, on the notion of turning to face the danger when further flight or escape is impossible, at bay.
laurel shrub (Laurus nobilis, source of the bay-leaf), late 14c., but meaning originally only the berry, from Old French baie (12c.) "berry, seed," from Latin baca, bacca "berry, fruit of a tree or shrub, nut" (source also of Spanish baya, Old Spanish bacca, Italian bacca "a berry"), a word of uncertain origin. De Vaan writes that connection with Greek Bakhos "Bacchus" is difficult, as the Greek word probably was borrowed from an Asian language. Some linguists compare Berber *bqa "blackberry, mulberry," and suggest a common borrowing from a lost Mediterranean language.
Extension of the word to the shrub itself is from 1520s. The leaves or sprigs were woven as wreaths for conquerors or poets, hence "honorary crown or garland bestowed as a prize for victory or excellence" (1560s). Bay-leaf is from 1630s. Bay-berry (1570s) was coined after the sense of the original word had shifted to the tree.