How and where is the $variables variable used in templates etc. generated in Drupal? How and where is the $variables variables that is used in templates and theme functions generated in Drupal? 

Is there documentation anywhere that defines $variables?
The $variables associated array that are passed into functions such as MYTHEME_item_list($variables) are initialized by the caller of that function.