Including this Wikipedia article mostly because it's the only Wikipedia article I've seen to include the phrase "knee slapper." I also enjoy that whoever wrote this section explicitly calls this joke not very funny, with citation.
All tell a similar story: a slow-witted New York farmer is outfoxed by his (presumed urban) boarders; after they complain about the poor food being served, the farmer discounts the complaint by claiming he "kin eat anything", and the boarders wonder if he can eat a crow. "I kin eat a crow!" the farmer says. The boarders take him up on the challenge but also secretly spike the crow with Scotch snuff. The story ends with the farmer saying: "I kin eat a crow, but I be darned if I hanker after it." Although the humor might produce only a weak smile today, it was probably a knee slapper by 19th-century standards, guaranteeing the story would be often retold in print and word of mouth, thus explaining, in part, the idiom's origin.