It looks like it is originated as a slang term for drugs, then gained a broader usage in time. Below is an excerpt from The Routledge Dictionary of Modern American Slang and Unconventional English edited by Tom Dalzell:
And here is the earliest usage of the shit as a drug in 1967 from the book How to Talk Dirty and Influence People By Lenny Bruce:
(the earliest usage I could find)
There is an Urbandictionary entry related:
The best. Originated as a term to describe high quality drug substances. IE, "this is good shit."
Evolved to common usage for any item of high quality. However, in typical usage, the article "the" is required to denote superiority. Without the word "the" prefacing the word "shit," a different, usually negative, meaning applies.
There is also the shiznit but even shiznit is used instead of the shit.
shiznit: More "urbanized" form of the shit. Basically means really, really good. Other versions include:hella cool,tight, the best. [Urbandictionary]
the shiznit:
1.something really cool.2.used to express joy in something/someone.3.to express that something is really or very good. [Urbandictionary]
There is also a less common term, the junk.
The epitomy of being sick, dope, or tight. [Urbandictionary]
Note: One needs to be careful though, because the shits means diarrhea.
This expression, whether in its noun form have a beef, or its verb form, to beef, may come down to us from Cockney rhyming slang.
Beef rhymes with Thief
Beeves (archaic) rhymes with Thieves
Imagine a bustling market day. In the narrow streets, a neighborhood pickpocket weaves through the crowd, pursued by a stranger shouting, "Stop! Thief!" Imagine that none too few persons in the market know the thief, or consider themselves bound to him by common interest. To muffle the alarm, the bemused sympathizers call out "Hot Beef!" and amidst the confusion the rascal slips away.
Too fanciful for you? Well, then, if you will, accept only that Cockney rhyming slang is a real phenomenon, without delving into the reasons for its adoption.
From Historically Speaking:
This phrase has been around for a couple of centuries now and comes
from the London criminal underworld.
Well known for its use of cockney rhyming slang, phrases aren’t always
what they appear to be.
The traditional shout of “stop thief!” was mocked by being replaced by
“hot beef, hot beef” in criminal circles where it was thought that the
shouts of “stop thief” were nothing more than making fuss about
nothing.
The 1811 edition of the “Dictionary of the Vulgar Tongue” defines Beef
as: “to cry beef; to give the alarm.”
Here are four related entries from the Dictionary of the Vulgar Tongue (1811):
TO SING. To call out; the coves sing out beef; they call out stop thief.
BEEF. To cry beef; to give the alarm. They have cried beef on us.
Cant.--To be in a man's beef; to wound him with a sword. To be in a
woman's beef; to have carnal knowledge of her. Say you bought your
beef of me, a jocular request from a butcher to a fat man. implying
that he credits the butcher who serves him.
DUMMEE. A pocket book. A dummee hunter. A pick-pocket, who lurks
about to steal pocket books out of gentlemen's pockets. Frisk the
dummee of the screens; take all the bank notes out of the pocket
book, [D]ing the dummee, and bolt, they sing out beef. Throw away the
pocket book, and run off, as they call out "stop thief."
SQUEAK. A narrow escape, a chance: he had a squeak for his life. To
squeak; to confess, peach, or turn stag. They squeak beef upon us;
they cry out thieves after us. CANT.
Best Answer
The slang term certainly goes back to 2002. That's the publication date of Valerie Gibson's Cougar: A Guide for Older Women Dating Younger Men.
An item titled "It's a Jungle Out There," in Against the Grain (2002) [combined snippets] attributes coinage of the term to Gibson herself:
It also seems noteworthy that Gibson's book appears in Canadian Books in Print (2003) and that Gibson is Canadian. The attribution of the term to a Canadian website ("Cougardate.com") may explain where Gibson got the term, or it may indicate that the website adopted its name after having encountered Gibson's book. I couldn't tell from a brief (and yet too long) visit to the website how long ago it was launched.
Victoria Phillips, Confessions of a Scottsdale Cougar (2009) offers this anecdotal commentary on the term's origin:
Phillips doesn't provide any documentation to support this claimed origin, but the hockey angle is certainly consistent with the asserted Canadian origin theory mentioned by both Wikipedia and Etymology Online.
Site participant njuffa notes in a comment beneath this answer that the Internet Archive's Wayback Machine finds a webpage for CougarDate dated February 20, 2001, with a page copyright date of 2000. The page includes a brief statement of purpose ("A fun new approach to dating where women are Cougars and men are Willing Prey.") and a link (inactive) to a "cougar manifesto" that would undoubtedly have shed light on the characteristics of the "Willing Prey" of particular interest to members of "the Cougar Den." It follows that CougarDate is slightly older than Valerie Gibson's Cougar book, although the connection between the two (if any) remains undocumented. My thanks to njuffa for uncovering this information.