stinging insect, Old English beo "bee," from Proto-Germanic *bion (cf. Old Norse by, Old High German bia, Middle Dutch bie), possibly from PIE root *bhi- "quiver." 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 social activity of the insect; this was extended to other senses (e.g. spelling bee, first attested 1809; Raising-bee (1814) for building construction; 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.
BEE IN one's BONNET (mid-1800s+)
First mentioned in Deut. 1:44. Swarms of bees, and the danger of their attacks, are mentioned in Ps. 118:12. Samson found a "swarm of bees" in the carcass of a lion he had slain (Judg. 14:8). Wild bees are described as laying up honey in woods and in clefts of rocks (Deut. 32:13; Ps. 81:16). In Isa. 7:18 the "fly" and the "bee" are personifications of the Egyptians and Assyrians, the inveterate enemies of Israel.