How built in functions like theme_field() are called in drupal?
Consult hook_theme($existing, $type, $theme, $path).

It is called via theme() which can be called directly or indirectly on a render array

Each module that introduces a theme element will define a base implementation (what you are looking at in your question) for theme and other modules can override it if they wish.

Look at field.default.inc in Field module, line 212:

$info = array(
          '#theme' =&gt; 'field',
          '#weight' =&gt; $display['weight'],
          '#title' =&gt; $instance['label'],
          '#access' =&gt; field_access('view', $field, $entity_type, $entity),
          '#label_display' =&gt; $display['label'],
          '#view_mode' =&gt; $view_mode,
          '#language' =&gt; $langcode,
          '#field_name' =&gt; $field['field_name'],
          '#field_type' =&gt; $field['type'],
          '#field_translatable' =&gt; $field['translatable'],
          '#entity_type' =&gt; $entity_type,
          '#bundle' =&gt; $bundle,
          '#object' =&gt; $entity,
          '#items' =&gt; $items,
          '#formatter' =&gt; $display['type']
        );


Theme will then go through this process below to determine whether to render via template file or theme function (screenshot from page 82 of Drupal 7 Module Development).