Question about templates (3E/Classic)

Where did the template process/rules first appear in 3E and are there any rules or considerations for how to layer templates together?