Template files are PHP files (.php) which are used to generate web pages and which makes customization possible in WordPress. The more template files your theme has got, the more customization you can do. Some template files are used on all the web pages (like header and footer template files), while others are used only under specific conditions. WordPress decides which template files to load when, according to the template hierarchy rules.