How does a refrigerator function like a heat pump?
it has a heat exchanger and a compressor. Since you cannot creat or destroy energy and heat is a form of energy, to cool the fridge, you have to move the heat out of from inside the fridge. This is done by the evaporator and condenser - the coils that the refrigerant flows through. By moving the heat, it acts like a heat pump. That is why behind the fridge is always hot (some heat also comes form the compressor) Note: all A/C units that have the same basic build are also heat pumps.
Look up How does It Work + refrigeration. You'll see.