Hooks are the mechanism that makes WordPress extensible without modifying core code. Understand actions and filters, and you understand how WordPress works under the hood; you can customize virtually anything.
Actions
An action is a point in the code where WordPress says "this is happening now, does anyone want to do something?". wp_head runs in the <head> tag. wp_footer runs just before </body>. init runs at initialization. save_post runs when a post is saved.
You attach your own function with add_action('wp_head', 'my_function'). The function runs automatically at the right moment. No return value needed.
Filters
A filter modifies data. the_content filters post content before it's displayed. the_title filters the title. upload_mimes determines which file types can be uploaded.
The difference from actions: filters must always return data. Your function receives the value, does its thing, and returns the modified result. Forget the return and you output NULL, breaking things.
Priority and arguments
The third parameter in add_action and add_filter is priority. Default 10. Lower numbers run first. The fourth parameter specifies how many arguments your function accepts (default 1).
Priority matters when multiple functions hook into the same hook. If you want your filter to run after Yoast SEO's filter, set priority to 20 or higher.
Finding the right hook
WordPress Codex and Developer Reference list hooks, but the easiest way to find exactly which hooks fire is to use the Query Monitor plugin. It shows all actions and filters executing on every page.
Reading other people's plugin code becomes significantly easier when you understand hooks. It's the entry point to serious WordPress development.