Ground Source Systems, which can be used to heat both air and water, work by digging pipes into the ground to use latent heat that is stored within the earth.
This can take the form of either a bore hole that digs straight down into the ground outside the house or a system of pipes that run through the ground closer to the surface over a much larger area. The heat garnered from this is then pumped up into the building and used in the same ways as described above.