Understanding the Template hierarchy

You need to look how page templates are saved against a page in the wp_postmeta table. Each page is linked to the specific template it uses and this is saved under the meta key _wp_page_template. You can go and have a look at your own install how you db structure looks like and how page templates are save

WordPress does not use page slugs or page names but page id’s to create the relationship to the page template assigned to it. Also, WordPress does not use the template name to create the relationship to the page, but the page template file name. In the case of the default template, page.php, it is simply saved as default and not the file name

For that reason, you can rename the page slug and the template name to whatever you like and still have the relationship between the specific page and the template it uses.

Example:

enter image description here