system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What really happens when bread, cookies, chips, and other similar foods go "stale"?
gpt
It has to do with changes in the structure of the molecules that give the food its usual texture, but the specifics vary depending on the type of food in question and what it's made of.

With foods that are normally moist and pliable/chewy (bread, cake, some cookies, etc.), the starches (long chains of sugars) that make them up spread out when cooked and link together, forming a sort of flexible mesh that's responsible for its texture. As the moisture from the environment begins to evaporate, the starches begin to crystallize, making them and the overall structure much more rigid, so it loses its pliability. It's essentially the same process as what happens with jello: when it has lots of moisture trapped inside of it, the overall structure is relatively pliable, but when you decrease the moisture, it becomes more rigid and brittle. Similarly, if you add heat to stale bread, it will help to recoup some of its chewiness and original texture (a bit of moisture helps with this too). 

Try microwaving a sale dinner roll for a few seconds (with a damp paper towel, ideally) and see for yourself. It's the same idea as remelting jello by exposing it to heat (and maybe some water) and letting its structure reform.

Now with foods that are normally crispy (chips, croutons, breading, etc.), it's kind of the opposite: you want them to be dry and have a rigid molecular structure, so adding heat and/or moisture will cause their structure to become more pliable and chewy in texture.