It depends on the box your using.
Some boxes maintain a subscribed list in the actual box.
When you first plug up the box it contacts the cable company, gives its serial/id numbers and retrieves the list of channels you pay for. It updates the list every few hours/days.
Then when you change the channel the box compares the internal list.
The cable company wouldn't know what channels you are watching, just what you are subscribed to.
The other kind of box, doesn't maintain an internal list. Instead when you change the channel, it contacts the cable company, asks it if that channel is one of the channels you pay for and either approves or denies your request to watch the channel.
That kind of box allows the cable company to know exactly what channels you are watching and at what times.
Most companies use the first kind of box, the second one causes lots of network traffic and makes changing the channel slower, since the box has to get approval on every channel change.