How does Instant Messenger work?

IM programs communicate only with special IM servers operated by that IM provider.  It keeps an open line of communication to your PC over the Internet and passes messages through instantly.  The server keeps track of who is online from your buddy lists and passes your messages back and forth, acting like a big telephone switch.  While they use the Internet, they do not use the Internet communications standards.  Instead each uses its own proprietary way of communicating.