How to interpret the code: module_invoke_all('user', 'logout', NULL, $user);? How to interpret this line of code?

module_invoke_all('user', 'logout', NULL, $user);


Obviously, it logs out the current user, but how do the four arguments make it happen?

I read through the doc, but I can't find information about the four parameters. 

Can anyone explain? 


From Documentation:
module_invoke_all()

Invoke a hook in all enabled modules that implement it.

Parameters
$hook The name of the hook to invoke.
... Arguments to pass to the hook.
No, they don't log the user out. That is done by the call to session_destroy() in user_logout().

That line only invokes the hook to tell other modules that the user was just logged out so they can react based on that.

The passed arguments are simply those that match the executed hook. Note that the Drupal 7 version is different from what you posted above, which is the Drupal 6 version.