How does add_option() function enable action hooks to fire right after actiavtion?

The important thing to note is that admin_init runs on every admin page load. So if you put a redirect inside that hook it will redirect every time you try to do something in the admin.

In this code when the plugin is activated an option is saved in the database, Activated_Plugin. The next time admin_init runs this option is checked and if it exists the option is deleted. This means that the option will only exist for one page load. So if you put code inside this check it will only run once, because the next time admin_init runs the database option won’t exist anymore.