tl;dr: Photons. CCDs and CMOSs are photon counters. The number that it counts per pixel is called the counts, the LUM, or the ADU.
The count value associated with a pixel in the raw light frame is a value that is proportional to the amount of charge that was built-up over integration time in that pixel. These are digital units derived from the on-chip analog-to-digital conversion process that is thought to be (to a first-order approximation) linear with respect to the voltage generated by electrons liberated from the material that composes the pixels of the detector.
So I've passed the question from “counts” to “voltage generated by liberated electrons”. Grant me that the piling up of electrons over the integration time generates a voltage. After that, what liberates the electrons? Answer: Energy. This energy may come in one of a few forms. (1) From a voltage applied to a pixel, (2) from the temperature of the electrons, or (3) from the radiative energy associated with incident photons. For a more delicate discussion of this, refer to ideas in semiconductor physics.
The voltage applied to a pixel and the temperature of the electrons clearly arise from the detector itself. These contributions to the counts must be calibrated away. After this calibration, the counts speak to only the liberated electrons by the radiative energy associated with incident photons.
That said, these incident photons are coming from the source as well as any sky brightness introduced by the atmosphere between the telescope and the source. Further, this same atmosphere scatters away and absorbed some of the light that would otherwise make it to the detector. For these reasons, the atmosphere must also be calibrated away.
After this calibration, the counts remaining in the image should be proportional to the energy received from the source alone. Further photometric calibration can be performed to relate these counts to some magnitude scale or to some absolute scale via some measure of radiative quantities.