It's hard to tell exactly what type of sensor you are talking about (from discrete (individual) parts, a whole unit or what?) As for discrete parts, for infrared, the two most common are photodiodes and phototransistors.
A photodiode produces a small voltage when light hits it and a phototransistor conducts current when light hits it. So, when light hits the diode, a small voltage is produced, which is amplified and then processed in some way. The transistor reacts to light by allowing current to flow and that current flow is amplified/detected and also processed in some way. The simplest way to process the current or voltage is to amplify it to a level that could be considered completely on or completely off (binary). The binary signal generated by the circuit could be used by a microcontroller, such as the one in your TV remote sensor.