Vayikra7:12

אִם עַל־תּוֹדָה יַקְרִיבֶנּוּ וְהִקְרִיב עַל־זֶבַח הַתּוֹדָה חַלּוֹת מַצּוֹת בְּלוּלֹת בַּשֶּׁמֶן וּרְקִיקֵי מַצּוֹת מְשֻׁחִים בַּשָּׁמֶן וְסֹלֶת מֻרְבֶּכֶת חַלֹּת בְּלוּלֹת בַּשָּׁמֶן׃

If he offers it for thanksgiving, he shall offer with the thanksgiving sacrifice unleavened loaves mixed with oil, unleavened wafers smeared with oil, and well soaked fine flour, loaves mixed with oil.

Vayikra 7:12

אִם עַל־תּוֹדָה יַקְרִיבֶנּוּ

Vayikra / Leviticus 7:12 · Pshat

Vayikra 7:12

אִם עַל־תּוֹדָה יַקְרִיבֶנּוּ וְהִקְרִיב עַל־זֶבַח הַתּוֹדָה חַלּוֹת מַצּוֹת בְּלוּלֹת בַּשֶּׁמֶן וּרְקִיקֵי מַצּוֹת מְשֻׁחִים בַּשָּׁמֶן וְסֹלֶת מֻרְבֶּכֶת חַלֹּת בְּלוּלֹת בַּשָּׁמֶן׃

If he offers it for thanksgiving, he shall offer with the thanksgiving sacrifice unleavened loaves mixed with oil, unleavened wafers smeared with oil, and well soaked fine flour, loaves mixed with oil.

Pshat פְּשָׁט

Thanks for a miracle

When you leave the hospital or come back from a long and dangerous road, you want to say thank you somehow. Not only in words, but in deeds.

Rashi: the thanksgiving offering is brought by someone to whom a miracle happened: who crossed the sea, went through the desert, came out of prison or recovered. Four kinds of bread are brought with it, ten loaves of each kind, and it is eaten for only a day and a night.

How Rashi explain it

Rashi If he offers it for thanksgiving

If he brings it to give thanks for a miracle that happened to him. For example, those who sailed the sea, went through the desert, were held in prison, or a sick person who recovered. They must give thanks, for of them it is written: "Let them thank the Eternal for His kindness and for His wonders to people, and let them offer thanksgiving sacrifices" (Tehillim / Psalms 107:21–22). If for one of these events he vowed to bring this peace offering, it is a thanksgiving peace offering. It needs the bread spoken of here, and it is eaten for only a day and a night, as explained here.

Rashi He shall offer with the thanksgiving sacrifice

Four kinds of bread: loaves, wafers and soaked flour, three kinds of unleavened bread, and it is also written: "with loaves of leavened bread" (Vayikra / Leviticus 7:13). Of each kind ten loaves, as explained in tractate Menachot (77a). Their measure is five Jerusalem measures (se'ah), which are six desert measures, twenty tenths of an ephah.

Takeaway

The four cases in which a person must give thanks are listed in Tehillim / Psalms 107: those who went through the desert, sat in prison, were sick, and sailed the sea. From here comes the blessing of thanks still said today.
An ordinary peace offering is eaten for two days and one night (Vayikra / Leviticus 7:16), but the thanksgiving offering only on the same day and the night after it (Vayikra / Leviticus 7:15).