What is the goal of template_preprocess_page(&$variables)?
It is an entry point in your theme or module that allows you to modify or add template variables before the page (or applicable item) is rendered. This hook affects any page*.tpl.php files.

Similarly, template_preprocess_node is the same, but for node templates.

Example:

I need to change existing variable foo:

function mytheme_preprocess_page(&amp;$variables) {
  // $foo used to be 'Old Value'
  $variables['foo'] = 'New Value';
}


I need to add new variable:

function mytheme_preprocess_page(&amp;$variables) {
  // $baz does not yet exist
  $variables['baz'] = 'Baz!';
}


These are injected into the template, then they can be rendered with render or printed:

page.tpl.php:

&lt;?php print $foo; ?&gt;
&lt;?php print $baz; ?&gt;


This is because $variables are passed by reference (note the &amp; symbol) which allows you to modify the array.