The templates are a combination of code (html, js, css) and variables. The whole idea is that the variables should be replaced with different values with each campaign afterwards. While the rest of the code remains the same. The variables could be of different types (i.e. image upload, hyperlink, text, number, dropdown)
Let me give the simplest example possible, which would be a simple image ad.
<a href="[%CLICKURL%]" target="[%TARGET%]"><img src="[%IMAGE%]" alt="[%ALT%]"></a>
You may add some inline JS/CSS to the template code as necessary. So, this would be a simple image banner template. It would have 4 variables: CLICKURL (type: Hyperlink), TARGET (dropdown with two options: _blank and _top), IMAGE (image upload), ALT (text).
So once created, the DFP User could create a new Creative based on the template and he would need to fill this 4 predefined fields in order to create the new banner.