For example in the user module there is a hook_user_login hook
When a user logs in in function user_login_finalize() will be called, then user_login_finalize will call user_module_invoke('login', $edit, $user);
that will call system_user_login (and others module's function[moudulename_user_login] that implements hook_user_login());
I am puzzled at which function will call hook_user_login() and when it will be Invoked. What is the role of this function?