Why was it called cat in the hat when the cat never really was in the hat?

The words "in the" are often used to mean "wearing" as in:

Who is that guy in the pink jumpsuit?

Who is that girl in the judo outfit?

So "Cat in the Hat" really means "Cat wearing the Hat", which he was, of course, till the hat and everything else he was balancing all crashed down onto the floor.