This is a good overview. It goes into the difference between the three main types:
https://processwire.com/docs/tutorials/how-to-structure-your-template-files