The fundamental reason for having a refrigerator is to keep food cold, that is, refrigerated. Low temperatures contribute to prolong the shelf life of food. The basic idea behind refrigeration is to decrease the activity of bacteria (present in all foods) so that it takes longer for them to spoil food.
For example, the milk left on the kitchen sink for a period of 3 hours at room temperature, is doomed to the action of the bacteria and consequent disuse. However, by reducing the temperature of the milk, it will remain fresh for up to a week or two - the low temperature inside the refrigerator is that it reduces the activity of bacteria in this way. When we freeze the milk, we stop the activity of the bacteria completely, and the milk can last for months (although it can suffer the effects of the so-called freeze-burning).
Refrigeration and freezing are two of the most common methods of preserving food used today.