In the story of Purim, Haman, the high official to the Persian king, planned to kill all the Jews in the empire. But long story short, his plans were foiled by two protagonists to the story, Esther and Mordecai. To celebrate Haman’s defeat and the prosperity of the Jewish people, the holiday is celebrated by creating hamantaschen, which are made triangular to symbolize Haman’s favorite 3 cornered hat.  To eat hamantaschen on Purim is symbolic of the Jew’s defiance of bowing down to him and preventing him from carrying out his evil plan. In addition to his hat, there are many other hypotheses of the symbolic representation of the triangular cookie, for more information check out this detailed story of Purim.