Christmas crackers were invented in 1846 by the British Confectioner, Thomas Smith. On a trip to Paris he found a bon-bon, a sugar almond wrapped in tissue paper. He decided to take this idea and included poems wrapped around the sweet. And then developed it further by adding the cracking noise when its pulled apart.
In later years he decided to add a surprise gift and a party hat. Eventually the poems were replaced by novelty jokes.