stinging insect of the genus Apis, living in societies under a queen and producing wax and honey, Old English beo "bee," from Proto-Germanic *bion (source also of Old Norse by, Old High German bia, Middle Dutch bie), from PIE root *bhei- "bee."
Used metaphorically for "busy worker" since 1530s. Sense of "meeting of neighbors to unite their labor for the benefit of one of their number," 1769, American English, probably is from comparison to the combined labor and social activity of the insect; this was extended to other senses (such as spelling bee, first attested 1809; Raising-bee (1814) for building construction, logging-bee for a log-rolling; paring-bee for preparing harvested apples; also hanging bee "a lynching").
To have a bee in (one's) bonnet (1825), said of one who is harebrained or has an intense new notion or fancy, is said in Jamieson to be Scottish, perhaps from earlier expressions such as head full of bees (1510s), denoting mad mental activity.