Treasure generation work like Raze said, it's predefined by feeding a 'seed' created from the last treasure generation to the next treasure generation which results in the same outcome all the time. If you change the order in which you open containers or force new trade inventory generation, the treasure will change of course (but only if two different treasure tables are involved).
There are no triggers for treasure generation other than 1 realtime hour passed or the request for trading (opening the trade window) of a character with a higher level than the one the trader has stored (i.e. after level-up). At least there is nothing else in the Osiris code and nothing else has ever been reported so far, so it must be a case of 'seems like but is not'. (In the end only the devs know if they built in some hardcoded thing that could bypass the story code.)
Where I disagree is the 'balancing' thing, IMO it has absolutely nothing to do with balancing but only with pleasing the envious bunch of whiners who could not stand other people do save scumming to generate different loot. (Must be some telekinetic quantum mechanics effect that affected their games when others did save scumming. Save scumming was everybody's own choice, nobody was forced to do it, but as we all know, people hate freedom ... at least for others ...)
Loot sucks in D:OS, it's a Diablo style loot system without the respawn required to make such a system work (I'm sure it will suck in D:OS2 too). Save scumming was people's - natural - workaround for the shortcoming of this system and this was taken away because of loud whiners.
(But that's my personal opinion of course.)
I've put tons of work into XC_Bags to make the sh....ty loot system matter less.
I've written about some of my own experimenting with treasure generation in the tread
Some info about treasure generation in the modding forum.