Before it was a meeting, a brainstorm was a legal defense for murder.
The word is a plain English compound of brain and storm. Its first meaning was medical and grim. Etymonline finds it by 1861 as a colloquial term for a "fit of acute delirious mania," a sudden and often violent loss of reason. George Gould's 1894 medical dictionary defined it as "a succession of sudden and severe phenomena, due to some cerebral disturbance."
According to World Wide Words, the word was almost unknown in the United States until March 1907. That month Harry Thaw stood trial for shooting the architect Stanford White. His defense argued that a sudden brainstorm had driven him to it. The Washington Post called the word a new piece of slang. Not everyone bought it: in 1919 a New Jersey paper called it "more or less a fake defense."
The meaning then flipped from madness to cleverness. World Wide Words dates the "bright idea" sense to the late 1920s, mainly in the US. Etymonline records it by 1934. A 1936 Popular Mechanics article called the radio announcers and engineers who handled big news breaks and special programs "brainstorm boys."
The group sense came from advertising. Alex Osborn was a founding partner of the agency that became BBDO, Batten, Barton, Durstine and Osborn. In 1939, frustrated that staff struggled to produce campaign ideas alone, he began hosting group sessions. He first called the method "organized ideation." His participants started calling them brainstorm sessions, for using the brain to storm a problem.
Osborn used the word in his early-1940s book How to Think Up. His 1953 Applied Imagination made brainstorming famous. One of his rules is still quoted: "The crazier the idea, the better; it's easier to tone down than to think up." Etymonline dates the verb to brainstorm to 1947.
The group sense reached Britain during the Second World War. It is now the main meaning on both sides of the Atlantic. The word's darker first life has almost disappeared, which is why a defense lawyer's brainstorm and a marketing team's brainstorm sound nothing alike.