They have a secret algorithm, but basically at 7 days out they will fill any unsold Z or J inventory, which is part of the reason why Confirmed Upgrades were scrapped, because they used the same Z inventory.
They rarely OneUp C inventory, but apparently in very lightly-loaded cases will sell D inventory to high bids.