basics of wordpress hooks : actions and filters
To change the default functionality in the wordpress theme or plugin you use wordpress hook. You can add custom hook , without affecting the core theme, plugin or wordpress files
Why you need to use wordpress hooks, the main advantage of use of hooks is that it wont override or erased custom code added to plugin, theme or wordpress files when you update to next version.
In WordPress there are two types of hooks – Action Hooks and Filter Hooks.