.Xauthority is actually a security feature of X, the graphical system. It part of what prevents unauthorized access to your graphical session(s), key loggers or tracking mouse clicks for example.
Security is a broad topic, and .Xauthority is one part of security mind you and covers local access, not necessarily tracking of mouse clicks by web sites ;)
Xauth allows access to anyone who knows the right secret. Such a secret is called an authorization record, or a magic cookie. This authorization scheme is formally called MIT-MAGIC-COOKIE-1.
The cookies for different displays are stored together in ~/.Xauthority. Your ~/.Xauthority must be inaccessible for group/other users. The xauth program manages these cookies, hence the nickname xauth for the scheme.
For additional information, see: