Original: Even though the heat pump can heat, it still uses the same basic refrigeration cycle to do this.
Simplified: At the other end of the cycle, the refrigerant boils again.