If you see at the front of your remote, you will see a LED. This is used to send InfraRed signals to the device intended. The front of your TV, or other device able to be controlled by the remote has a InfraRed light Detector. When you press a button on the remote, it sends out a signal, the light detector on the device picks it up and executes the command.
But remote cannot get the things done just by sending IR signals.
There are 20+ buttons on your remote. So they must have some kind of code for the signals. That id where the Binary codes come into play. When you press a button, the remote generates a series of on/off pulses of InfraRed in terms of Zeroes and Ones - just like the computer does. Thus the LED on the remote sends strings of these binary codes each different for each function. For instance, the code (001100) may stand for OFF, (110000100) may stand for VOLUME UP. The light detector detects the signals, decrypts it and the microprocessor inside executes the function.
The Infrared remotes need line of sight to work. Which means they cannot pass through walls or impediments. Also they have a range of about 2 or 3 metres.
Current breed of remotes tend to use RADIO FREQUENCY (RF) waves. Though a bit costly compared to IR remotes, they have more range and also work through impediments.