When fragments get requested, the following process determines which fragment will get used.
The request coming from the action (for programmers: see IAction::SetFragment()) contains:
First the system figures out which scopes are assigned to the requested fragmentID. In other words, it looks up the scopemask of this fragmentID. Typically the fragmentID determines the scopemask by itself, but it is possible to specify 'overrides' and select different scopemasks based on the global tagstate and requested fragtags. See the file format section in the article on the controller definition file for more on how this is set up. Also, if the calling action requests a specific SubContext, the scopemask and global tags coming from this SubContext's definition will extend the ones from the original request. Finally, the scopemask can optionally be extended by the action's 'forced scopemask'.
The final scopemask now contains the list of scopes this action will be installed on, and it determines which scopes will host fragments in the next step.
For each scope in the scopemask...