A heat pump is often described as a fridge in reverse. The refrigerant is expanded and compressed as in a fridge but the cold loop instead of cooling the fridge, is sent out to be warmed up by a ground loop (typically long lengths of pipe under a field) while the warm water loop is sent off to heat the house. (Diagram - Spirit Solar)