Forum:Loot generation question

I have searched around for the answer but had no luck, so I was wondering if anyone happened to know at what point does the game assign loot that drops or appears in chests/skag piles/etc?

Is it when they are killed/opened? Or is it when the "zone" is first created for that game session? or when that mob is generated by the game due to player interaction/proximity?