Refrigeration is the keeping of foods at low temperatures to preserve them for an extended time, even if still quite short. Keeping foods cold slows down all the processes of life, including biochemical processes and the activity of spoilage micro-organisms. This uses the fact that heat energy relates to how quickly molecules move and vibrate, with hot objects and molecules moving faster than cold ones; as a result, chemical reactions are quicker in hotter than colder conditions.
Refrigeration only became common after World War I, but this technique had long been known about because ice and cooler weather was understood to prolong food life. Prior to then, cool cellars and larders had been essential in house. A typical domestic fridge is at about 3 - 5oC (37 - 40oF). This will prolong the shelf life of perishable foods - vegetables, salads, dairy products and meat. The lower temperature of a fridge preserves food, by slowing down the growth and activity of spoilage and harmful microorganisms; therefore, your food takes longer to go off and any harmful bacteria are at sufficiently low levels to be killed off by thorough cooking.
The ability of cold and ice to preserve foods has been known about for many years. The romans would chill perishable foods by packing them in snow brought from the Alps. In the Middle East, icehouses were used to prolong the life of perishable foods, which was taken up in Europe during the Renaissance and was common in the US until quite recently. For icehouses, ice is collected from lakes or mountains during winter-time and stored in insulated buildings, sunk into the ground. If well looked after, there will enough ice to last through to winter. But these methods were exclusive to the rich.
Another method that was available to all relied on the evaporation of water through unglazed earthenware pots. This relies on the fact that when a liquid - e.g. water - evaporates, it uses energy to move from the liquid to gas phase. This removes energy from the water and transfers it to the gaseous water, resulting in the water left behind in the earthenware pot being cooler. This is also way the earthenware pot is unglazed because it enables water molecules to be pulled through and evaporate away. This method has been extensively used - e.g. by Arabs in Portugal through to cooling water today in parts of India.
In Italy during the 16th century, it was found that water mixed with salt freezes at a lower temperature than 0oC (32oF) at -18oC (0oF). This is the basis of the Fahrenheit scale where its base is the freezing point of strong saltwater not water, and is also the required temperature for a commercial freezer; there is generally a rationale behind even some of the most obscure facts. The basis for the lower freezing point is that a solution of a substance in water will always freeze at lower than water's freezing point. On the other hand, when ice melts, ice and meltwater both have the same temperature as the melting point of water, even if this is lower than the melting point of pure ice.
In the 1830s, there were attempts to make a mechanical refrigerator based on the cooling effect of water as used in earthenware pots. However, these were unsuccessful. It required the invention of the heat pump in 1851 by William Thompson (Lord Kelvin) - a liquid is made to evaporate by lowering the ambient pressure and without heating it, so that it becomes extremely cold; this cold vapour is piped around a closed container and the heat of whatever is in the container passes into the vapour, so the contents are cooled; after this the vapour is piped out of the container (the refrigerator) and compressed to reliquefy it, which releases the heat transferred to the vapour; finally the liquid is vaporized again and so cooled, and starts the cycle again. This process endlessly takes heat from the container and transfers it into the cooling liquid and releases it back out to the air, hence why the back of a mechanical refrigerator heats the surrounding air.
In 1857, the first mechanical refrigerator was made by Ferdinand Carré, a Frenchman. It was based on the concept above, but using a refrigerant fluid of ammonia dissolved in water. Carré's fridge relied on boiling the ammonia out of water by heating it - ammonia boils at a lower temperature than water. The ammonia is passes into another vessel where it condenses to a liquid before flowing into another chamber where the pressure is reduced forcing the ammonia to evaporate and become very cold; it then passes through the food compartment, cooling the food, then flows into another vessel containing water into which it dissolves and the cycle can recommence. This system can get down to temperatures of -30oC (-22oF) and was soon used to commercially freeze meat. Carré's refrigerator could both freeze and cool foods, but was too large for domestic use. The domestic refrigerator has to wait for electric motors to become both small, reliable and relatively cheap. The first models were the Kelvinator refrigerators launched in the US in 1918. From this, domestic refrigerators (the fridge) has become indispensable in modern kitchens.
Another discovery that helped domestic refrigeration was the invented of chloroflurocarbons (CFCs) in 1931. These were excellent refrigerants; they do not need to be dissolved in water unlike ammonia and function as described in the first paragraph. However, in the 1970s, CFCs were found to destroy the ozone layer and have been phased out, replaced by hydrochlorofluorocarbons (HCFCs). This has enabled the domestic fridge to help keep food from perishing quickly, and the ozone layer is being rebuilt and has declined in size by early 2016 - showing that people can work together to keep the planet healthy.