The term "hat trick" originated in cricket in 1858 when a bowler named H.H. Stephenson took three wickets with three consecutive deliveries. To celebrate this achievement, a collection was taken among the spectators to buy him a hat as recognition. This practice led to the term "hat trick" being used for achieving three successes in a row, especially in sports like cricket, and later adopted by other sports like hockey and soccer. The tradition of awarding a hat or fans throwing hats onto the field or ice stems from this origin, symbolizing the accomplishment of scoring three goals or taking three wickets consecutively in a game.