bean (n.) Look up bean at Dictionary.com
Old English bean "bean, pea, legume," from Proto-Germanic *bauno (source also of Old Norse baun, Middle Dutch bone, Dutch boon, Old High German bona, German Bohne), and related to Latin faba "bean;" Greek phakos "lentil;" Albanian bathë "horse-bean;" Old Prussian babo, Russian bob "bean," but the original form is obscure. Watkins suggests a PIE reduplicated root *bha-bhā- "broad bean;" de Vaan writes that the Italic, Slavic and Germanic "are probably independent loanwords from a European substratum word of the form *bab- (or similar) 'bean'."

As a metaphor for "something of small value" it is attested from c. 1300 (hill of beans as something not much to amount to is from 1863). Meaning "head" is U.S. baseball slang 1905 (in bean-ball "a pitch thrown at the head"); thus slang verb bean meaning "to hit on the head," attested from 1910.

The notion of lucky or magic beans in English folklore is from the exotic beans or large seeds, carried from the Caribbean or South America by the Gulf Stream, that wash up occasionally in Cornwall and western Scotland. They were cherished, believed to ward off the evil eye and aid in childbirth.

Slang bean-counter "accountant" recorded by 1971. To not know beans (American English, 1933) is perhaps from the "of little worth" sense, but may have a connection to colloquial expression recorded around Somerset, to know how many beans make five (1830) "be a clever fellow."