system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why does milk, even if heated up, go bad if left out, but baking with milk such as to make cookies or cake not go bad quickly?

What happens to the milk that causes it to react so differently in these two scenarios even though both involve heating up milk?
gpt
Low temperature slows down bacteria growth which is why we refrigerate foods to begin with. Milk has an extremely short shelf life otherwise, so if you leave it out the bacteria in the milk very quickly multiplies until eventually there's enough of it to make you sick.

When you're cooking food that contains milk, you're both rapidly heating it (which doesn't really give the bacteria time to go crazy) and generally heating it to the point that you're killing bacteria.