There are two main reasons to refrigerate something. To prolong freshness and to prolong flavor.
Nothing can prevent something from spoiling that can spoil. So, the most the refrigerator can do is slow down the process of spoilage so the product lasts much longer. A steak will go bad in hours on a counter top. But will last for days in a refrigerator. This is what we typically think about what a refrigerator does and why we put stuff in it. But that's only one reason.
Another reason is to prolong flavor. Besides by spoiling, some foods just lose their flavor if left out in the open. The refrigerator slows this flavor loss. It can prolong flavor by months or years.
Some foods that never spoil will lose their flavor. This is the surprising part. Many foods will last forever in an open container on the shelf in your pantry. They would just taste horrible over time. In fact, many of the "Refrigerate After Opening" warnings are for flavor reasons only.