The book But How Do It Know? mentions an old thermos' related joke of someone asking "How does a thermos know something is hot, in order to keep it warm, or cold, in order to keep it cold?"
Joe is a very nice fellow, but has always been a little slow. He goes into a store where a salesman is standing on a soapbox in front of a group of people. The salesman is pitching the miracle new invention, the Thermos bottle. He is saying, "It keeps hot food hot, and cold food cold...." Joe thinks about this a minute, amazed by this new invention that is able to make a decision about which of two different things it is supposed to do depending on what kind of food you put in it. He can’t contain his curiosity, he is jumping up and down, waving his arm in the air, saying “but, but, but, but…” Finally he blurts out his burning question "But how do it know?"
The punchline's phrasing, though, seems to be off. A grammatically correct sentence, in my understanding, would be "But how does it know?"
Is it because it is being uttered colloquially? Or maybe in order to paint the person asking it as a simple, ignorant person?
Are both correct then, each of them in its specific context?