The story
Possibly from able, as in able seaman, and whack.
First known use, by meaning
- from 18th c. Blows on the hand from a knotted or twisted handkerchief, especially given as a punishment to the loser of certain card games.
Etymology from Wiktionary, CC BY-SA 4.0.