‌Most air conditioning units these days are heat pumps which means they are capable of both heating and cooling. The unit produces heat by working in reverse cycle. The external unit coil trades place with the internal one and becomes the evaporator taking the heat from outside air.