Question: Please explain the sources in the Torah and halacha for the custom to make a seudat hodaya (meal of thanksgiving) following recovery from a serious illness or surgery.
Answer: One of the korbanot the Torah describes is a Korban Todah (sacrifice of thanksgiving) (Vayikra 7:12). However, the Torah does not say when one offers it. The gemara (Berachot 54b), in the context of Birkat Hagomel (blessing after surviving dangerous situations), says that the "survivors" of four situations have to give thanks: a voyage at sea, traversal of the desert, illness, and captivity. The gemara demonstrates how each of these situations is described in Tehillim 107, the mizmor that deals with thanks after being saved from difficult situations. Even at the time of the Beit Hamikdash, it appears that people such as these were not obligated to bring a Korban Todah. Rather those are among the appropriate situations to volunteer one (see Rashi, Vayikra 7:12 and a thorough presentation in Nishmat Avraham, Orach Chayim 219:1).
Eating is a major element of the Korban Todah. This korban included 40 loaves of meal-offering, 36 of which were to be eaten. The Abarbanel and the Netziv (both on Vayikra 7) famously explain that the Torah required a lot of eating in a short amount of time to encourage the thankful person to bring together many people where he would hopefully give proper public thanks to Hashem.
What do we do without a Beit Hamikdash to bring a Korban Todah? The Rosh (Berachot 9:3) and the Tur (OC 219) say that Birkat Hagomel was instituted in place of the Korban Todah. While the simple reading is that Hagomel is an obligatory beracha, the Magen Avraham (beginning of 219; Pri Megadim, ad loc. disagrees) suggests that it might be optional. In any case, it provides a defined opportunity to thank Hashem publicly (it must be recited before a minyan, preferably including two distinguished people- Shulchan Aruch, OC 219:3).
Whether or not the Korban Todah or Birkat Hagomel is obligatory, a seudat hodaya for being saved from dangerous illness is certainly not obligatory. This may explain its absence from explicit discussion in most classical works (including the Shulchan Aruch). However, significant sources provide precedent and support for the idea of doing something more than saying Hagomel, including a seuda. The Mishna Berura (218:32, in the name of "Acharonim") says that one who was saved from possible death (apparently even if the salvation was natural) should do the following. He should set aside money for tzedaka and say that he wants it to be considered as if he spent the money on a Korban Todah, donate things that help the public, and on every anniversary find a special setting to thank Hashem, be happy, and tell His praises. Certainly, a seudat hodaya is an appropriate setting for it, but it is not part of a set formula.
The gemara (Berachot 46a) tells that when Rabbi Zeira was sick, Rabbi Avahu promised that if he recovered, Rabbi Avahu would make a festive meal for the rabbis, which, baruch Hashem, occurred. Some say that not just the meal but the promise to make it is significant, as the promise of such an event if the sick person recovers is a segula (good omen) for the recovery (see Gilyonei Ephrayim, ad loc.). This would evidently only work if the seuda of that nature is desirable. The Chavot Yair (70; see also Pri Megadim, Mishbetzot Zahav 444:9) in discussing different meals that are a seudat mitzva, mentions the seuda after being saved from danger. While some seudot mitzva are obligatory, many are not but are positive ways to give prominence to noteworthy events.
We will end off on a hashkafic note. Rav S.Z. Auerbach explained (see Mizmor L’todah (Travis) p. 185) that by eating in the context of thanksgiving to Hashem one expresses the following idea. A person should know and show that the goal of life and the physical world that he is enjoying after his recovery is to serve as a medium through which to further his spiritual life and give thanks to Hashem
23 - Paper Ownership of Non-Kosher Food