We have already briefly talked about Presence, but there's actually a lot more to it. Presence works through the concept of conflict-free replicated data types (CRDTs). The general premise behind Presence and how it was built is that, to actually be able to track users as they join/leave/go away, you need to be able to track the state change over time and resolve that change with other servers as well, since most applications today are clustered in some way.
The difficulty comes from when you have multiple servers that are all in charge of recording a user's state. If you have three servers and one goes down, and another server records a user signing off, and then another server records the user signing on, which one wins? ...