Bamidbar22:28

וַיִּפְתַּח יְהוָה אֶת־פִּי הָאָתוֹן וַתֹּאמֶר לְבִלְעָם מֶה־עָשִׂיתִי לְךָ כִּי הִכִּיתַנִי זֶה שָׁלֹשׁ רְגָלִים׃

And the Eternal opened the mouth of the she-donkey, and she said to Bilam: "What have I done to you, that you have struck me these three times?"

Bamidbar 22:28

וַיִּפְתַּח יְהוָה אֶת־פִּי

Bamidbar / Numbers 22:28 · Sod

Bamidbar 22:28

וַיִּפְתַּח יְהוָה אֶת־פִּי הָאָתוֹן וַתֹּאמֶר לְבִלְעָם מֶה־עָשִׂיתִי לְךָ כִּי הִכִּיתַנִי זֶה שָׁלֹשׁ רְגָלִים׃

And the Eternal opened the mouth of the she-donkey, and she said to Bilam: "What have I done to you, that you have struck me these three times?"

Sod סוֹד

Three festivals against three traits

Envy, desire and the thirst for recognition live in everyone. It is hard to overcome them by willpower alone. One needs days in the year that heal each of them.

The Shem MiShmuel: the three traits of Bilam's (Balaam's) disciples, an evil eye, a haughty spirit and a wide soul, are envy, the craving for honour and desire, which take a person out of the world. The three festivals heal them: Pesach heals pride with the bread of poverty, Shavuot heals desire with the Torah, Sukkot heals envy with trust in the Eternal. That is why Bilam wanted to uproot precisely the three festivals.

How Shem MiShmuel explain it

Shem MiShmuel That you have struck me these three times (רְגָלִים)

In Rashi: she hinted to him: you seek to uproot a nation that celebrates three pilgrimage festivals (רְגָלִים) a year. And in the "Likkutei Torah" of the Ari it says that Bilam (Balaam) wanted to uproot the three festivals from Israel. And one must reflect: how are the three festivals stronger than the other commandments of the Torah? It seems the point is this. The sages said (Avot, chapter 5): an evil eye, a haughty spirit and a wide soul belong to the disciples of the wicked Bilam. And it seems that these three are envy, desire and the craving for honour, which take a person out of the world. An evil eye is envy, a haughty spirit is the craving for honour, and a wide soul is desire. And they lead to idolatry, forbidden relations and bloodshed: envy to bloodshed, desire to forbidden relations, the craving for honour to idolatry, for whoever is proud is as if he worships idols. And it is known from the Maharal that the three fathers, Avraham, Yitzchak (Isaac) and Yaakov (Jacob), mended these three sins, and by their merit there are three festivals that give Israel strength and might to stand against these three.

And one can say more. Pesach, the beginning of Israel's entry under the kingship of Heaven, is the opposite of idolatry, as the sages said: "Draw your hands away from idols and take for yourselves sheep for the commandment." And its commandment is the bread of poverty, a hint at a humble spirit, the opposite of the trait of Bilam, who had a haughty spirit. Shavuot is against desire, as the Rambam said: desire overcomes only a heart empty of wisdom. And even more they said: let him turn his heart from idle talk to words of Torah. And the preparation for the Giving of the Torah was separation, and the Torah endures only in one who is humble. Sukkot is against the evil eye and envy. Sukkot is their opposite: it is trust in the Eternal, the opposite of envy of another, that is, a good eye. That is why it has the commandment of the lulav: let them all become one bundle, and these will come and atone for those. So these three festivals fill Israel with the opposite of Bilam's traits. That is why Bilam especially hated the three festivals and wanted to uproot them from Israel.

Takeaway

The three traits of Bilam's (Balaam's) disciples are named in Mishnah Avot 5:19.
The Maharal is Rabbi Yehudah Loew of Prague, author of many books on the thought of the Torah. The Ari is Rabbi Yitzchak Luria, a teacher of Kabbalah in Safed.
The bread of poverty is matzah (Devarim / Deuteronomy 16:3). "Draw your hands away from idols" is how the sages read the words "Take for yourselves sheep" before the first Pesach (Shemot / Exodus 12:21).
The lulav is the palm branch taken on Sukkot together with myrtle, willow and etrog. The midrash says of the four species: let them be tied in one bundle, and these will atone for those (Vayikra Rabbah 30:12).