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]
"garland or wreath for the head," late 14c., from Old French chapelet (Old North French capelet) "garland, rosary," properly "a small hat," diminutive of chape, chapeau "head-dress, hood, hat" (see chapeau).
"fashionable knot in a woman's dress or hat," 1883; earlier "small, round, cream-filled pastry" (1706), from French chou, literally "cabbage" (12c.), from Latin caulis "cabbage," literally "stalk" (see cole (n.1)).
"a hat," 1520s, from French chapeau (Old French capel, 12c.) "hat," from Vulgar Latin *cappellus, from Late Latin capellum (also source of Italian cappello, Spanish capelo, Portuguese chapeo), diminutive of cappa (see cap (n.)). Especially a hat forming part of an official costume or uniform.
mid-14c., "bishop's tall hat," from Old French mitre and directly from Latin mitra "headband, turban," from Greek mitra "headband, turban," earlier a belt or cloth worn under armor about the waist, perhaps from PIE root *mei- "to bind, attach" (source also of Sanskrit mitra- "friend, friendship," Old Persian Mithra-, god name; Russian mir "world, peace"). The Greek word might be borrowed from Indo-Iranian.
In pre-Christian Latin, in reference to a type of head-dress anciently worn by inhabitants of Lydia, Phrygia, and other parts of Asia Minor, "the wearing of which by men was regarded in Rome as a mark of effeminacy" [OED]. But the word was used in Vulgate to translate Hebrew micnepheth, the sacerdotal head-dress of the ancient Jewish high priests.