Even in complete darkness, all objects emit thermal radiation. Thermal radiation is light in the long-wave infrared range, which is invisible to the human eye. It is precisely this long-wave infrared radiation that a thermal imaging camera uses to generate an image.
Basics of thermal imaging technology: https://www.zeiss.com/consumer-produc...