You press a button the channel on the TV changes, simple.
When a button is pressed the voltage across one of the pins on the chip changes.
The chip wakes and waits for the crystal to settle and allow the internal clock to start running.
The first task is to discern which button has been pressed. The buttons network forms a grid. A 49-button remote will usually use a 7 x 7 layout. 14 connections to the chip.
The chip will set each of one set of seven lines high and see if there is a voltage on one of the other 7. From that an individual button can be isolated.
Each function on a remote control is assigned a number. Sometimes manufacturers choose 1 for channel 1, 2 for channel 2 then 13 for volume up and so forth. The chip will have a list of this numbers for each button stored in a table. Now that the chip has determined which button has been pressed it will fetch the number to send to the TV.
Alongside this number there might also be an additional code. As the remote chips are usually 8 bits there are potentially 256 different numbers that can be sent. However, to keep the numbers consistent across a range of items, different TVs and DVD players there can be a lot more than just 256 different numbers used. So in effect they might allocate functions as A1..A256, B1..B256 ETC.
If everyone used the same numbers, there is going to be a big problem. I.E. you press a button and it turns the TV off but also makes the DVD eject the disc and the air conditioner go into overdrive. So, each manufacturer has their own header number too. 90% of manufacturers opt for a standard 4 number system and a set way of encoding the information. There are however a myriad of alternate ways that are used to send information from the remote to the device.
The chip will be configured to send a code out at a specific frequency. Typically 37khz, but can be 36khz, 40khz or even over 100khz
Once the information has been sent the chip then goes back to looking at the state of the keypad. Is the button still held down? If so, then something has to be sent to let the TV know. If you hold the volume down the TV might keep on raising the level, but if you keep button 1 down for a while you don't want to go to channel 11111111111.
If the button is no longer down the chip goes back into sleep mode to save battery power