Normally, cooking is allowed on Jewish holidays, but only for consumption on that day, and not for consumption after the holiday. Technically, either if such a holiday occurs on Friday, cooking is allowed for the Sabbath, but the rabbis forbade this in order to prevent confusion on other years (when the holiday does not immediately precede the Sabbath) unless this ritual of eruv tavshilin is performed, which would remind the people of the reasons for the exception, or it is a facilitation continuing from prior preparation.
This ritual consists of cooking and baking some food for the Sabbath before the holiday begins. The food must consist of (a minimum of) an egg-size amount of bread or "Matzoh" and an olive-sized amount of cooked food. After being set aside, a blessing must be recited, and the food must be eaten on Shabbat. Because the "dishes" or "servings" are "mixed", meaning we have "mixed" the time of preparation between the day prior to the holiday with a food that may be eaten on the day after the holiday (which will be the Shabbat), this thereby allows for cooking to take place on the holiday itself which is not considered a "new" cooking, but rather a continuation of the "mixed" cooking that has already "begun" before the holiday started.
(Source: Chapter 1 of "Festivals & Fasts, A Practical Guide", edited by Yakov Blinder.)
- Days of week on Hebrew calendar for when eruv tavshilin is prepared
- The Whys, Hows, and Whats of Eruv Tavshilin - Laws of Eruv Tavshilin at Yeshiva.co