The current is maximum through those segments of a circuit that offer the least resistance. But how do electrons know beforehand that which path will resist their drift the least?
This is really the same as Adam's answer but phrased differently.
Suppose you have a single wire and you connect it to a battery. Electrons start to flow, but as they do so the resistance to their flow (i.e. the resistance of the wire) generates a potential difference. The electron flow rate, i.e. the current, builds up until the potential difference is equal to the battery voltage, and at that point the current becomes constant. All this happens at about the speed of light.
Now take your example of having let's say two wires (A and B) with different resistances connected between the wires - lets say $R_A \gt R_B$. The first few electrons to flow will be randomly distributed between the two wires, A and B, but because wire A has a greater resistance the potential difference along it will build up faster. The electrons feel this potential difference so fewer electrons will flow through A and more electrons will flow through wire B. In turn the potential along wire B will build up and eventually the potential difference along both wires will be equal to the battery. As above this happens extremely rapidly.
So the electrons don't know in advance what path has the least resistance, and indeed the first few electrons to flow will choose random paths. However once the current has stabilised electron flow is restricted by the electron flowing ahead, and these are restricted by the resistance of the paths.
To make an analogy, imagine there are two doors leading out of a theatre, one small door and one big door. The first person to leave after the show will pick a door at random, but as the queues build up more people will pick the larger door because the queue moves faster.
They don't. Electrons follow the path of least resistance in the same way that water flows downhill. The electrons do not act collectively, each individual electron is driven away from other electrons, and driven toward positive charges. The collective result is well described by the statement that they follow the path of least resistence.
Electrons go where the electric field pushes or pulls them. That is how they "know" where to go. In a resistance electron drift slows down so the electrons tend to pile up in front of it. This creates a repulsive field and pushes electrons away toward another conducting channel.