Heat pumps use electricity and do not actually generate heat, but instead have a fan which draws in heat from the outside air that has been warmed by the sun. This warm air is extracted by a fan and circulated through an evaporator air coil which absorbs heat and transforms it into a gas.
The gas is pumped into the compressor which concentrates the heat and then moves into the heat exchanger.
As the gas and water from the pool is pumped through the heat exchanger, the hot gas transfers its heat to the water. The water is heated 3-5 degrees as it passes through and then the warmer water flows back into the pool.
Heat pump pool heaters work efficiently as long as the outside temperature remains above the 45–50ºF range. The cooler the outside air they draw in, the more energy they use. However, since most people use outdoor swimming pools during warm weather, this usually isn't an issue.