(To) know what’s what
Sometimes said of society matrons who understand perfect etiquette and the science of dinner-table seating. Or pundits who know local political gossip and the status of the financial markets. The term first appears in Hudibras by Samuel Butler (1663):
He knew what’s what, and that’s as high
As metaphysic wit can fly.