For your specific example, Mega Bool has a “fuzzy match” for mega but a full match for “mega bool”, so it is matched to mega bool.
The main (Mega) brand template tags are then applied, and then mega bool’s tags are applied on top of them, overriding some of them.