Where is the $content of a page build?
If you are referring to the $content variable that is available in node.tpl.php, its value is set in template_preprocess_node() from the following code:

  // Helpful $content variable for templates.
  $variables += array('content' =&gt; array());
  foreach (element_children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }


$variables['content'] is then passed to field_attach_preprocess().

  // Make the field variables available with the appropriate language.
  field_attach_preprocess('node', $node, $variables['content'], $variables);


To alter the content of the $content variable, you can implement hook_preprocess_node() (in a theme, or a module), or hook_field_attach_preprocess_alter().

Remember that what in a template file is $content, in other places is $variables['content'].