So the phrase "the bee's knees" approximately means "it's fantastic" (my definition at least!). But how did this phrase come about?
It's alliteration of the business, in the sense of exactly what you need to get the job done. But whilst I believe this commonly-held assumption helps the expression retain currency, it's probably not relevant to the original coinage (see below).
In the same vein, a (Cockney) friend of mine habitually refers to an excellent example of something (a fine wine, quality musical instrument, whatever) as the guvnor, where younger people might be more likely to say it was boss.
Admittedly, in this letter to Jonathon Swift (1667 – 1745) from his friend Dr Thomas Sheridan, the good doctor is just flippantly writing in phonetic style - but note I that he writes an ape is till a bout bees knees for an epistle about business. Clearly the aural pun itself isn't a recent innovation.
As regards how and when the bees knees started to be used as a term of approbation, the earliest clear example I can find in Google Books is this from 1923. World Wide Words gives more details of how this expression was part of a relatively short-lived frivolous slang fashion doing the rounds in 1920s America.
That craze spawned a plethora of such "animal/attribute" pairings, including elephant’s adenoids, cat’s miaow, ant’s pants, tiger’s spots, bullfrog’s beard, etc. Which are mostly long-forgotten now, apart from cat's whiskers/pyjamas.
Coarse as ever, we Brits came up with the dog's bollocks about the same time, though I think this was probably unconnected to the US fad.
But even though the US first came up with bees knees, it was actually the Brits who revived it, along with our own dog's bollocks, in the 70s and 80s. In particular, Viz magazine was always fond of these expressions (their hardback 1989 "omnibus edition" was called The Dog's Bollocks). All with due deference, no doubt, to the Sex Pistols 1977 album Never Mind the Bollocks.
I found some slightly earlier datings than 1923. The earliest 1907 makes the pun on business, some are just nonsense, and several 1922s are in the form [somebody/something]'s the bees' knees.
A probable 1909 in this nonsense in the Lyceumite and Talent:
[somebody/something]'s the bees' knees
A possible 1922 Radio broadcast: Volumes 2-3 suggests it was amateur radio slang:
Another possible 1922 is in The re-ly-on bottler: a ... magazine of ideas and ideals for the ...: Volumes 3-6:
A 1922 North Western druggist: Volume 30:
A 1922 Cosmopolitan:
A 1922 Them was the good old days: in Davenport, Scott County Iowa by William L. Purcell also has a cat's pajamas:
But the 1922 Chicago Dental Society's Bulletin, Volume 3 is the best: