What does ‘Know Your Onions’ mean?

Got full marks on your math test? You must really know your onions. While it sounds smelly, this phrase actually serves as compliment meaning knowledgeable or clever. It reportedly derives from a man called S.G. Onions who used fake coins to teach children about money. If they picked up the lessons, they would then know their onions, according to BBC.