A template is all the code needed to display a layout pattern on a web page. Templates aren’t content – they are containers for content.
Here’s an illustration: say you have a project page that displays your photos in a grid together with a heading, some text copy and a site navigation menu. A single template can be used to display each of your project pages – each populated with unique content…
Say you have some special project photos that have a skinny proportion and so don’t fit well with our template’s grid of images. We’ll develop another template to cope with the condition.
See also Web Templates on Wikipedia.