Solution:
Though technically it executes without a problem but WordPress added all this hook helper function to exhibiting the difference in content changes (Filter hook) and logical changes (action hook).
If you closely noted line 404, the function add_filter
is called inside the function add_action
even without changing the passed argument so basically these are for just convention and saying to others what’s your intention.
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/plugin.php#L404
If it is a filter hook there is structural change else if it is action hook there is some logical process that’s all.
Kindly read this interesting article to know more.
https://wpsmith.net/2011/the-difference-between-do_action-add_action-and-add_filter/