Not quite randomly, because any molecules that overlap initially will react immediately. We want the viewer to have time to visually comprehend the initial scene before things start happening.

Accordingly what happens is that each molecule is inserted randomly but may not overlap any already-placed molecule. There is a maximum number of times the program will try to insert a new molecule without overlap before it gives up and just sticks the molecule in any old place. That's because at high concentration the packing problem of putting objects randomly into a volume without overlap (even if there is in principle space for them) is extremely difficult. Indeed, if we knew how to solve that problem efficiently we could solve many important theoretical problems in the physical chemistry of fluids, because much of this chemistry is dominated by the packing problem.

But we digress.