First, before I launch into an explanation, let me recommend the definitive book on this topic, W.Richard Stevens'
TCP/IP Illustrated, volume I. Everybody interested in this stuff should have a copy of this, and his "UNIX Network Programming" as well.
Now: telnet is interesting. The protocol allows for option negotiation, so that it can do all sorts of neat stuff (window size changes!) but is designed in such a way that a very dumb implementation and a very smart implementation can talk to eachother just fine; furthermore, a very dumb implementation looks just like a plain, ordinary socket with no logic behind it.
Therefore, a real telnet server accepts connections from real telnet clients, does some negotiation to see who will echo characters, what terminal type will be used, etc, etc, and then executes a shell and connects the client to it.
But you can also use a telnet client to talk to a "dumb" server -- basically, any server that just opens a socket and waits for text commands.
The trick is that the telnet server, not the client, initiates the negotiations. If the client doesn't hear any negotiation commands coming from the server, then it just passes keystrokes through, more or less untouched.