Could also be used to mask stale or spoiled foods that if cooked enough, wont kil you and still contains nutrition. Nothing goes to waste. Another could be preservation as is the case for salt.
Salt is much simpler than that. It's a vital nutrient and if you don't eat enough of it, you'll die. It's useful for preservation, sure, but you're not eating it because you couldn't find fresh food. You're eating it because it's salt.