They usually work by drawing moist air over a refrigerated metal coil with a fan. The water in the air condenses, and drips into a collecting bucket. The air is then reheated by the warmer side of the refrigeration coil.
See also humidifier, an appliance that increases the humidity of air.