This is an American phrase, first recorded in the May 1922 edition of Harpers Magazine:
"Mr. Roberts knows his onions, all right."
According to World Wide Words, this had nothing to do with any Mr. Onions, but:
The crucial fact is that the expression isn’t British
but American, first recorded in the magazine
Harper’s Bazaar in March 1922. It was one of a set
of such phrases, all with the sense of knowing
one’s stuff, or being highly knowledgeable in a
particular field, that circulated in the 1920s. Others were to know one’s oats, to know one’s
oil, to know one’s apples, to know one’s eggs,
and even to know one’s sweet potatoes (which
appeared in a cartoon by T A Dorgan in 1928).
You may notice certain similarities between the
substances mentioned, most being foods and most having names that start with a vowel.
They contain much of the verbal inventiveness
and mildly juvenile wordplay that characterises
another American linguistic fad of the flapper
period, that of describing something excellent of
its kind in terms of an area of an animal’s
anatomy (elephant’s instep, gnat’s elbows and about a hundred others — see my piece on bee’s knees for more).
As with bee’s knees, one of these multifarious
forms eventually triumphed and became a
catchphrase that has survived to the present day.
The Phrase Finder agrees:
Other phrases that refer to
knowing - 'know the ropes', 'doesn't know shit from Shinola' etc. allude to specific items as
the focus of the knowledge.
Other 1920s variants of 'know
your onions' are 'know your oil/
oats/apples' etc. The only one that caught on and
is still in common use is 'know your onions'. So, why onions? Well, as the citation above asks -
why not? Explanations that relate the phrase to
knowledgeable vegetable gardeners, or even to C.
T. or S. G. Onions, are just trying too hard. 1920s
America was a breeding ground for wacky
phrases (see the bee's knees for some examples) and this is just another of those.
Edit: A tantalising snippet in Google Books shows this may have been used in 1908 in a humorous poem in The Postal Record (Volumes 21-22 - Page 27). It' shown in the summary, and is interesting as the year 1908 is also shown. Care must be taken with snippets, as they're sometimes incorrectly dated, but here it is anyway:
But, never mind; Billy knows his onions, He Is not troubled with corns or bunions. He travels along at a good, fair gait; Unless the roads are bad, he Is never late. O. 8. WHITE. WHkesbarre, January 1, 1908. West Hoboken, N. J. At the regular meeting of Branch 1065, held on January 10, 1908, it was honored by the presence of Brother Kelly, President of our National Association.
etymology of what a dish O'Conner & Kellerman
Both “dish” and “toothsome,” terms for good things to eat, have been applied to sexy people.
From ~ 700 AD (tooth) to the Middle Ages until well into the 19th
century, the expression “to (or for) one’s tooth” meant to one’s
taste or liking, according to the Oxford English Dictionary
“Toothsome” is used to describe an attractive woman. What is the
origin of this usage? Is there some connection to calling someone “a
real dish”?
and the end of the article ...
Shakespeare may have been the first to use “dish” in this figurative
way, in reference to sexy Cleopatra: “He will to his Egyptian dish
againe.” (From Antony and Cleopatry, 1606.)
But this was probably just a passing metaphorical use. It wasn’t until
the 1920s that “dish” came to be used this way in general English.
The earliest modern example in the Random House Historical Dictionary
of American Slang is from Variety, that fountainhead of American
slang: “She ought to be a swell-looking’ dish in tights” (Nov. 25,
1921).
Best Answer
One interesting feature of this quotation is that it began appearing with some regularity, usually attributed to Lincoln, in the middle 1890s, some three decades after Lincoln's death (April 15, 1865). Another is that most of the earliest citations specifically attribute the quotation to Lincoln. A third is that, even at that early period, a key element of the expression—the identity of those that God must love—appears in three distinct forms: the poor, the common people, and the plain people.
The earliest printed reference to the quotation that I've been able to find uses the "common people" wording. From John Durham, "The National Unitarian Conference," in the [New York] Independent (November 7, 1889):
But an instance of "the poor" pops up four years later, in an appeal to President Grover Cleveland from C.C. Goodwin, editor of the Salt Lake [City, Utah] Tribune, in the Washington Post, reprinted as "A Letter to Grover," in the Aspen [Colorado] Evening Chronicle (September 14, 1893), referring to Lincoln although not by name:
Anna Worden, "The Advancement of Woman" in Margaret Yardley, The New Jersey Scrap Book of Women Writers, volume 2 (1893) repeats the "common people" version:
And "Direct Legislation," in Railroad Trainmen's Journal (March 1894) has simply "common people":
The earliest instance of the "plain people" variant appears in Albert Cook, "Chautauqua: Its Aims and Its Influence," in The Forum (August 1895):
In contrast, the earliest source to cite someone other than Lincoln as the author of the saying is Keyes Danforth, Boyhood Reminiscences: Pictures of New England in the Olden Times in Williamstown (1895)—and his attribution is by no means precise:
Nevertheless, Martin Tullai, "So Abe Didn't Say It, But He Should Have: Who Said It?" in the Baltimore Sun (August 30, 1992) asserts just as firmly that there is no record of Lincoln's actually having said or written it:
To some extent that view is supported by the fact that in a speech before the House of Representatives on April 20, 1896, Representative Talbert of South Carolina felt free to make the observation as if it were original to himself:
This doesn't sound like a politician invoking a famous saying of a famous president, although as a post-Reconstruction South Carolinian, Talbert may not have been eager to credit Lincoln as his source of his apothegm. In any case, the earliest of these matches comes about 30 years after Lincoln's death.
Assessment
The earliest recorded instance of the quotation in question appears in late 1889, slightly more than 24 year after Lincoln's death. The delay in attribution is explicable if we accept that people simply hadn't heard the statement at the time it was made and that it emerged 20 years or more later in some a biography of Lincoln or a memoir about working with him. It is certainly a point in favor of Lincoln that, even in 1889, he is the person to whom the saying is ascribed.
On the other hand, 24 years is a long time to keep something so catchy and quotable under wraps. It is also problematic that the details of whom Lincoln made the remark to and under what conditions are inconsistently reported. C.C. Goodwin, writing in 1883, asserts that Lincoln was speaking to "his nearest advisor." A story in the January 29, 1901, St. Paul [Minnesota] Globe has it that the comment arose in response to an arrogant opposition senator:
And another journalist, writing in the December 1903 issue of Success magazine, provides a vignette in which the remark arises in response to a Congressman's embarrassment at presenting the president with a petition from the voters of his district:
That is, by late 1903—less than 15 years after the first print reference to the expression that I could find—writers cite at least three different contexts for the remark, three different people the remark was directed to, and three different versions of who the speaker says God must love.
Lincoln is identified early and often as the source of the remark about common/plain/poor people. But the absence of any record of the quotation from the 1860s or before, the 24-year gap between Lincoln's death and the earliest mention of the quotation that I could find, inconsistencies in the details of the anecdote early in its period of popularization, and significant inconsistencies in the wording of the quotation all point toward the conclusion that Lincoln was not the originator of the expression.
Ultimately, the fact that political hagiographers, who would have found the quotation perfect for their purposes of glorifying the martyred president as a brilliant but down-to-earth man of the people, overlooked the quotation for more than two decades following Lincoln's assassination may be the strongest piece of circumstantial evidence that the expression arose some time after his death and is the work of an uncredited aphorist.