WordPress Tutorials
Adding Menu Items with wp_nav_menu_items
The filter hands you the menu as a finished HTML string, which is why it is quick for a login link and useless for anything structural. It also never fires for the Navigation block, which is most menus on block themes.