You might not believe it, but there’s chemistry in baking cookies.

You stick cookie dough into an oven, and magically, you get a plate of warm, gooey cookies. Except it’s not magic; it’s science. Stephanie Warren explains via basic chemistry principles how the dough spreads out, at what temperature we can kill salmonella, and why that intoxicating smell wafting from your oven indicates that the cookies are ready for eating.

Watch more of these videos from Ted-Ed.