A template engine will take a preformatted client side or server side template(based on html or any other syntax) and transform it to usable html that can be added to your web page. (A good article to get started about template engines is the following: http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more)
The only problem is that every day, a new template engine appears. To help you pick the right tool for the right job, you can use the Template-Engine-Chooser:
Remark: I noticed that the tool didn't work on Internet Explorer.