XenForo hooks are code snippets inside XenForo templates to execute any code in PHP via a plugin or template_hook event listener.
The syntax for such code snippet is
Hooks can be recursive in nature and can contain hooks inside a hook. The hook listener is executed at the start of the hook and not at the end. Any plugin, want to execute a code for the hook, will create a listener to either all the hooks and check the conditional or can listen to a particular hook.
Here is the Complete Visual Guides to XenForo Hooks.