The Nielsen company doing surveys of a percentage of households is how they know. Nowadays they even have a tracker you wear that reports back to Nielsen what you’ve been watching/listening to based on what it can hear, in the old days it was a form folks filled out saying what they watched or listened to