Dehumidifiers use exactly the same components as a heat pump and their method of operation is to operate simultaneously cooling unit and a heating unit, although ultimately they positively contribute to the heating effect whilst also removing moisture. This is in stark contrast to full loss air systems which also impose a thermal heating load.
Dehumidifiers: Firstly the air is cooled (evaporator) to below its dew point so that water condenses out of the air, removing moisture from the air stream. The same air is passed over the condenser coil where hot refrigeration gas re-heats the cold air. The result is that the air is reheated to beyond its original temperature (because the compressor energy is added to the process) with much less moisture in it than it originally had and hence the air is significantly dehumidified without losing heat.
This is a very energy efficient method of dehumidification which also results in supply temperatures being greater than inlet temperatures. It should be the default primary solution for applications such as Swimming pools etc but is often side lined by the short term view of cheaper but much less efficient solutions such as full fresh air.