Twig is a modern template engine for PHP. It is fast, flexible, and more secure. Twig is a template framework and is a direct replacement for PHP Template. There are lots of differences between PHP template and Twig.
Drupal 8 is developed with help of Symfony2 framework, and the template files in Drupal 8 are in twig format.Read on to find out more about twig and debugging of twig.