It works roughly similar to how most refrigerators or an air-conditioner works: a fluid is brought down to a cold temperature in the warm section, and sent back to the cold section where it absorbs heat, then it goes back to the condenser. One source of heat is the left-over heat of the spacecraft, but another is the spacecraft's own electronics, some of which are close to the actual instruments to process data from observations. Most of the electronics are in the much warmer spacecraft bus, but some of the electronics needed to be much closer, and great lengths were taken to reduce the heat they produce.