So extensions, and rulesets, can have a "loadorder" defined. a value from 1 to 100, higher order loads last. But it is not required that a loadorder be defined. I don't know if its predeictable what happens with two extensions with a conflicting loadorder or if none is defined (maybe it defaults to 0?)
The later an extension is loader, the more authority it has, i.e. the last read instance of a function overwrites what was defined before. unless a MERGE=join is defined for that file, windowclass or function.
Rulesets can also define a parent, which in itself can have a parent. So most rulesets are children of CoreRPG. So CoreRPG loads first, then D&D5E (or such). I think PF1E is actually a child of 3.5, so its Core>3.5>PF1.
Often extensions completely overwrite core or parent ruleset functions and files that they don't need to. It's because most of us are not coders either, and we hack. SmiteWorks over the last year or so has made Core and the supported rulesets much easier to modify in part, without us having to overwrite everything to achieve what we want. But again, most of us are hacks, not coders :)

