An IR transmitter contains an LED that emits infrared light. Thus the name. The receiver contains either a photodiode or a phototransistor (usually the latter). This component passes more or less current depending on the amount of IR light falling on it.
The LED is switched on and off in a coded sequence.