in the sports sense, 1879, originally in cricket, "taking three wickets on three consecutive deliveries;" extended to other sports c. 1909, especially ice hockey ("In an earlier contest we had handed Army a 6-2 defeat at West Point as Billy Sloane performed hockey's spectacular 'hat trick' by scoring three goals" ["Princeton Alumni Weekly," Feb. 10, 1941]). So called allegedly because it entitled the bowler to receive a hat from his club commemorating the feat (or entitled him to pass the hat for a cash collection), but the term probably has been influenced by the image of a conjurer pulling objects from his hat (an act attested by 1876). The term was used earlier for a different sort of magic trick:
Place a glass of liquor on the table, put a hat over it, and say, "I will engage to drink every drop of that liquor, and yet I'll not touch the hat." You then get under the table; and after giving three knocks, you make a noise with your mouth, as if you were swallowing the liquor. Then, getting from under the table, say "Now, gentlemen, be pleased to look." Some one, eager to see if you have drunk the liquor, will raise the hat; when you instantly take the glass and swallow the contents, saying, "Gentlemen I have fulfilled my promise: you are all witnesses that I did not touch the hat." ["Wit and Wisdom," London, 1860]
People are apt to sneeze, in hot weather for example; and people do not die of sneezing now-a-days, as they did in days that no one knows any thing about. We cannot give six draughts a-day, at one and nine pence each, for sneezing: call it the hay-fever. What a wonderful man! what a clever man! he understands the hay-fever: call him in! Thus is the hay-fever among the last in the list of fashionables. ["On Fashions in Physic," London Magazine, October 1825]
Latin, hic iacet, "here lies," commonly the first words of Latin epitaphs; from demonstrative pronominal adjective of place hic "this, here" + iacet "it lies," third person singular present indicative of iacēre "to lie, rest," related to iacere "to throw" (from PIE root *ye- "to throw, impel").