The common idea is that the action of injecting the insect repellent induces herd behavior in the ants. When ants are in "panic", they experience a strong tendency to follow each other. As a result, if a random fluctuation in the system produces a locally large amount of ants trying to reach one of the two doors, the fluctuation can be amplified because ants tend to follow the direction of the majority of individuals, resulting in that door getting crowded.