http://neemtree.com.au/drupal-theming-designers
mi sembra spiegato bene... ovviamente è PHP che analizza e "riempe" i template..