Where does drupal determine which theme file to use for an entity field?
Everything can be overridden by one hook in any module so bear that in mind. 

The theme registry is where everything is stored in terms of theming for pages/entities. It all depends on the order here in determining the theme it will use. 

You can use the devel module and dpm out the theme registry:

https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_get_registry/7

It usually is built in this order: 


module where entity is created
module where function was called to get the entity
your theme directory


but at any point that could have been overridden