A polite sentence has more content to it, but tends to be vague. Instead of saying "Who are you?", we have the ultra polite "sochira-gata wa?" ("that individual is?" = "who are you") As the politeness level goes down, and the conversation becomes more casual, we also lose particles, so that the sentence gets shorter.
Sochira-gata wa donata desu ka?
Anata wa dare desu ka?
All of these phrases mean "who are you?", but they descend from most polite to least; and, from least direct to most. The last line requires that the listener also has to infer from some external context to convert "kimi" ("you")?" to "and you are?"
The point here is that to understand spoken or written Japanese, we have to understand the context as well as the politeness level. In fact, during casual speech, up to half of the meaning can be given to us indirectly from context, rather than being spoken directly. Of course, the same thing can happen in English, but it happens more often in spoken Japanese.
To be continued...