One of the widespread customs in all the communities of Israel during Purim, to increase the joy, is to eat Oznei Haman - the so-called hamantashen, "Haman's ears" - which are triangular-shaped baked cookies filled with some type of preserve. In various books, it has been noted that an explicit origin for this custom is not found in ancient sources, and many have struggled to discover its root and deep meaning. Some even came to think it was an error or a linguistic confusion related to translations into other languages.
However, we will see below that Rabenu—who lived about three hundred years ago—explicitly mentions this custom and beautifully explains its meaning. In fact, the Zera Shimshon is the first known source that provides a foundation for this practice.
Rabenu says, in an ingenious style: a reason can be given for the fact that all of Israel is accustomed to preparing sweet Oznei Haman ("Haman's ears") on Purim. Why specifically ears, and not eyes, hands, or another organ? And furthermore: how is it possible to sweeten the limbs of Haman the wicked, who was entirely cursed, perverse, and bitter?
The answer is as follows: the verse says, "Incline your ear and your soul shall live" (Yeshayahu 55:3), and our Sages in the Midrash teach (Shemot Rabbah 27:9) that everything depends on the ear. Whoever inclines his ear to hear words of Torah and reproof gains life, as it is said: "The ear that hears life-giving reproof" (Mishlei 15:31). Until the time of Haman, Israel had not wanted to incline its ear to fully accept the yoke of the Torah. But in the days of Haman, they inclined their ear and accepted the Torah anew, and this was for their good.
Therefore, the "sweet ears" that we make and eat are not Haman’s ears in a literal sense, but rather the ears of Israel, which thanks to Haman were inclined to hear the Torah. And a custom of Israel is Torah: true Torah.
(Zera Shimshon, Megillat Esther, Derush 21; see also Derush 10)