Hamantaschen originated in Europe. The term derives from two German words, mohn (poppy seed) and taschen (pockets). The association with Purim was solidified by substituting the name of Haman for mohn. Some hold that the hamantaschen symbolize the three-cornered hat that Haman wore.
There are actually many foods that came to be associated with Purim, but hamantaschen emerged as the most popular delicacy. The three-cornered pastry, traditionally filled with poppy seeds, apricots, or prunes, has become an essential element in Purim's joy.