mapping of menu Name "Main Menu" with variable name: primary_nav
$primary_nav is template variable in Garland's template.php file. It's a variable specific to this Drupal core theme. The HTML markup is rendered by the theme_links(). 

The main argument to the theme function is page template variable $main_menu, which is defined in theme.inc. This variable is set by menu_main_menu(), which will retrieve a menu id setting then use that to look up data in the menu_links table (noted by menu_name column).