Although Word 2013 is shown as the base, this applies to Word 2003, 2007, 2010 as well.
I had thought that the attached template would always be the template used to create the document unless that template was not available or someone changed the attached template. I was mistaken.
I recently had the opportunity/excuse to test what happens if there are multiple templates with the same name. I was surprised by the results.
If a template with the same name is in the folder containing the document, that becomes the attached template.
If a template with the same name is in the User Templates folder and there is none in the document folder, that template becomes the attached template.
If a template with the same name is in the Workgroup Templates folder and there is none in the document's folder nor in the user templates folder, that template becomes the attached template.
The Custom Office Templates folder is not searched.
If a template exists on one of those three locations and you try to attach a template of the same name that is located elsewhere or lower in the hierarchy, Word will not do it. If you create a document based on a template with the same name as one in one of those locations, the document will be attached to the original template when you create it, but when you reopen it, it will attach to the template in the preferred location.
Templates of the same name stored in sub folders of the User Templates or Workgroup Templates folder do not have this attribute.
I have memorialized these findings in my Templates page.
Which template is attached if there are multiple templates with the same name
The testing was done using Word 2003-2013 on a laptop running Windows 8.1. If anyone wishes to test on a different operating system to see if they get different results I welcome it.
Anyone experiencing problems with the attached template should also review Shauna Kelly's page:
What happens when I send my document to someone else? Will Word mess up my formatting?