The Sochatchover explains (Shem m’Shmuel Sukkos 5573) that the tochacha comes “tachas asher lo avadta es Hashem Elokecha b’simcha uv’tuv leivav,” (Devarim 28:47) because of a lack of simcha in avodas Hashem. Sukkos is called “zman simchaseinu,” a time of joy. It’s the opportunity to become inspired with a simcha inoculation against those curses of the tochacha.
But why davka is it the number of lambs that add up to 98 – why not count the cows or the rams as well? Let me preface the Shem m’Shmuel’s answer with a vort from R’ Gifter also on our parsha. In the parsha of bikurim the Torah commands, “V’smachta b’chol hatov,” (26:11) to rejoice over all the good that Hashem has given. When the farmer goes out to field to collect his bikurim, he sees the first fruits (literally) of months of labor. He can now feel confident that all the work and energy he put into his crops is going to pay off. Even if the Torah didn’t say it, the farmer would be happy. Why does the Torah need to command him to rejoice? Is it just so he can get mitzvah reward for what comes naturally?
R’ Gifter answers that there’s more to it than that. Every moment of happiness has the potential to be tainted by the feeling that “if only there was more.” I see this in my kids all the time. You give a child X as a treat, she will complain why she didn’t get Y or why X was not better, etc. (A real pleasure to deal with…) There are adults who live their whole lives this way. Chazal already tell us that if a person has manah, inevitably he/she wants masayim. This is the meaning of the tochacha coming because of a lack of “simcha v’tuv leivav” – you can have simcha but at the same time not have “tuv leivav;” your heart is not filled with joy because deep down there is that nagging feeling that there is more out there that you still don’t have.
The Torah therefore gives the farmer a mitzvah of simcha. True, any farmer would be happy given the situation, but that's 90% happiness, or 95% – there would still be that nagging, “If only the crops were a little better…” Torah/mitzvah happiness is 100% because it comes from the sense that not only does Hashem give 100% of what a person needs and deserves, Hashem gives 110%. The mitzvah of simcha is about absorbing that perspective.
Coming back to the korbanos of Sukkos, the Shem m’Shmuel reminds us that Avraham had a Yishmael; Yitzchak had an Eisav. Their simcha could never be 100% because there was an inescapable missing something in their lineage. Only Ya’akov was blessed with having every descendent for all eternity connected to the family of Klal Yisrael. Only Ya’akov had the 100% wholeness, that allows for 100% simcha. Therefore, it is on Sukkos, the chag connected specifically with Ya’akov, through the korbanos of lambs, offerings specifically connected with Ya’akov, that we can celebrate with complete 100% simcha divorced from any negative feeling, any lack of “simcha v’tuv leivav,” that would c”v bring us tochacha.