Cats have scent glands along the tail, on each side of their head, on their lips, base of their tail, chin, near their sex organs, and between their front paws. They use these glands to scent mark their territory. When the cat rubs you, he is marking you with his scent, claiming you as “his.” Too, he is picking up your scent. Cats rub up against furniture or doorways for the same reason – to mark the item as “his”.
Sometimes Fido gets really affectionate and rubs his head against my legs. When I sit down next to him he will rub his head against my foot. Sometimes when I’m petting him, he gets so happy he will try to rub his head on anything he can while massively purring. I guess he’s marking me as his, I should feel honoured that he has deigned to make me his. Except that he also rubs his head against the chair, the leg of the table, and most importantly, the Tupperware that holds his food. If I marked the spots where he rubs his head with post-its, the house would be covered with yellow tabs. When he’s hungry, he will MAO hungrily, then rub his head insistently against the Tupperware as if to tell me something. Like I love you but I love my food more FEED ME!