Template matching will NOT work if your content contains a field type that is not supported by the repository. It can be the case when you are in the process of a migration from eZ Publish 4.x, where custom datatypes have been developed.
The list of field types supported out of the box is available here.
You can define your template selection rules in a different configuration file. Read the cookbook recipe to learn more about it.
To be able to select the right templates against conditions, the view provider uses matcher objects, all implementing