It's random, and isn't related to stacks.
I'm not too crazy about RE'ing entire stacks unless they make it an option... or at least have a pop-up window to confirm the amount to RE.
Are you sure? I would hope that each stack would have it's own percentage, and chance to crit. Is there any way to unstack them? I hit 200 Biochem last night, and it's starting to get expensive to not know how it really works.