I was told in my physics class that more amount of current goes through less resistance wire and if there is a zero resistance wire all the current will go through it in a parallel arrangement.
Electrons of course do not think, nor have a divine knowledge of "oh, the electric meadow is greener in that direction, let's go over there !".
To answer your question, you can see electrons as tiny balls going in straight lines. Every time they hit a defect, they change (randomly, and not like a billiard ball) their direction. This is called electron drift-diffusion.
The number of defects is directly related to resistance. And by defect, I mean phonons (vibrations due to thermal noise, for instance), actual defects in the crystalline structure of the metal, or impurities, etc
The more defects, the more electrons are backscattered and the likelier they are to go through less resistive paths. Basically, it's a random process, with different probabilities.
The case of zero resistance is actually a whole other topic, involving supraconductors. And although supraconductors do have zero electric resistance, electrons coming from a resistive area into a supraconductive area do not just go there easily. For instance, they are subject to Andreev reflections.