Refrigerators have a cooling coil through which a cold gas is made to flow in the region of the refrigerator that needs to be cooled. The gas absorbs heat from inside the unit and gets heated up as a result of which it expands. The gas is then compressed outside the unit using a compressor; this releases a lot of heat that is expelled outside.
Frost is deposited on the cooling coil of the refrigerator as water vapor in contact with the cooling coil condenses to water and then freezes to form ice. The presence of frost decreases the efficiency as the cooling coil is no longer able to absorb heat from the interior. In conventional freezers frost has to be manually removed by shutting the unit for around 12 hours which helps in melting the layer of ice that has formed around the cooling coil.
Frost-free freezers work around this problem by using a heating element that covers the coiling coil. This is activated at definite periods of time determined by sensors placed in the refrigerator. The heating element melts any ice that has formed around the cooling coil. Though this method to remove frost comes with its own drawbacks it is widely used due to its advantages.
The fan in a freezer is basically meant to circulate cold air all around the unit that ensures a uniform temperature is maintained in the interior of the unit.