The answer to 'how does heat pump work' is a heat pump is a type of HVAC system that both heats and cools a home. It works by transferring heat from one place to another, using electricity to power a refrigerant system that absorbs heat from the air or ground outside and transfers it inside, or vice versa. This makes heat pumps highly energy-efficient, as they don't generate heat but rather move it.
Heat pumps have an indoor unit that circulates air through ducts, and an outdoor unit that contains the compressor and refrigerant coils. In heating mode, the outdoor unit absorbs heat from the outside air and transfers it inside. In cooling mode, the process is reversed, with the outdoor unit releasing heat from the home to the outside air.