I see that when you're reading a thread for example and you get a new personal conversation the system loads an AJAX notification. Is this in real time or it happens each x minutes? If so, is that value configurable?
I'll save you some time.
XenForo uses ajax to refresh your csrf token after you're inactive for a long period of time. If you keep your tab open for at least 50 minutes without focusing on it, next time you make it the active tab, it'll use ajax to refresh the token which also checks for unread messages and new alerts.
If you really are curious you can look at this area in xenforo.js: