The Book of Esther, read aloud in the synagogue at Purim, tells of Haman, chief minister to the Persian king Ahasuerus, who plots to have every Jew in the empire killed after Mordechai the Jew refuses to bow to him, and whose plot is undone when Esther, the king's Jewish queen, reveals her own identity and pleads for her people. Purim is kept as a day of reversal and celebration, with a festive meal, gifts of food to friends and to the poor, costumes, and a noisy retelling of the story in which listeners drown out Haman's name with noisemakers each time it is read, and hamantaschen belong to that same spirit of turning the villain into an object of harmless mockery rather than dread.
The pastry is made by folding a circle of dough up at three points to enclose a spoonful of filling, most traditionally poppy seed paste sweetened with honey, though prune, apricot, date and modern fruit or chocolate fillings are all common in different communities, and the dough is baked until the three corners hold their shape and the filling shows through the small triangular opening left at the center. Purim also obliges givers to send mishloach manot, gift baskets of food, to friends and neighbors, and hamantaschen are among the most common items packed into these baskets alongside other sweets and pastries, carrying the festival's spirit of celebration from one household to the next.