How does it determine when to repopulate the crate?

For instance, is it on the player accessing it? How long after does it repopulate?