The way this apparently works is that when the fish pulls on the lower hook it releases the spring and gets impaled by the second hook... The first OED quotes for "sockdolager" in the punch and fish senses both date from the 1830s, and it is not fully clear which came first. The Online Etymology Dictionary suggests very implausibly that the word is
said to be a variant of doxology, on a notion of "finality." The meaning "something exceptional" is attested from 1838. Sockdologising was nearly the last word President Abraham Lincoln heard. During the performance of Tom Taylor's "Our American Cousin," assassin John Wilkes Booth (who knew the play well) waited for the line "Well, I guess I know enough to turn you inside out, you sockdologising old man-trap," and as the audience laughed, Booth fired the fatal shot.
in which case the "punch" sense would most likely have come first; however, one is inclined to side with the Dictionary of Slang, Jargon and Cant which describes sockdolager as "a word inadequately explained by its imperfect resemblance to doxology" (but then goes on to offer an extremely silly Icelandic etymology). O. Henry's use in "Confessions of a humorist" possibly supports the derivation from doxology but is in any case far too late to be relevant. It is interesting, by the way, that the obvious derivation from "sock" is rendered implausible because sock (v.) as "beat" is attested only once (in a 1699 book of sailors' slang) before the coining of "sockdolager."