Certain foods are normally refrigerated, but after cooking can be kept at room temperature for a few days at least. An obvious example is cheese -- e.g. cheese-topped rolls normally have a best before date a few days after they reach the shelves. Many cake ingredients have to be refrigerated, but then the resulting cake can be kept at room temperature.
How can we tell which foods undergo this change? Alternatively, what's a change -- is it just drying and water activity (it might be, given that dried hard Italian cheese is shelf-stable).
The question is about the science but the motivation is things like savoury flapjacks as appetising carb-heavy snacks for cycling, when the sweet stuff becomes unappealing. For it to be worth making a batch, they should have keeping properties on a par with biscuits (cookies/crackers), i.e. almost forever if airtight (so longer than my first example, but that's because the bread would go stale).