At a simplistic level, an instant messaging service:
Accepts instant messages from external sites
Determines the user to which the message should be delivered, and routes it accordingly
Accepts instant messages from internal hosts
Determines the destination system to which the message should be delivered, and routes it accordingly
Provides presence updates for users who are online, offline, away, and so on
Of crucial importance to a good instant messaging service is that the service provides for scalability, high availability, reliability, and good performance.