Templates and similar solutions form the conceptual basis for modularly separating the application solution from the presentation within a software architecture. Templates make it possible to subsequently replace the graphical user interface with alternatives with significantly less effort. Themes and skins are closely related to templates and are therefore used as synonyms in practice.
Further references:
https://de.wikipedia.org/wiki/Vorlage_(data processing)
http://www.webmasterpro.de/coding/article/php-ein-eigenes-template-system.html
The following video explains the basic concepts of templates: