This is a really old classic, from not long after the American Civil War.
Legend has it there was a joke going around in those days, quite a fad, in which the joker would ask a victim if he knew Tom Collins. Back in the days before mass immigration and the coming of the Kowalskis, the DiFrancescos, the Sousas, the Suzukis, and the Rodriguezes, if you knew a hundred people there was a pretty good chance that you knew a Collins.
Well, the way the joke goes, Mr Collins had said something very rude about the victim, who would roll up his sleeves and storm off muttering "Why, I oughta..." before ending up in an embarrassing situation.
Like the Monkey Gland and others, the joke begat a drink, and this is it.