How can gel electrophoresis be used to detect mutations?
Because a change in DNA sequence will generation a slight change in charge which will effect the migration rate in electrophoresis.
Electrophoresis is basically the movement of particles in a fluid under the influence of a constant electrical field. Where positive or negative particles will move towards their counter electrodes.
The addition of a porous medium (a gel) for the separation will function as a retarding or sieving agent. This will slow down the movement or "migration" speed of larger molecules and/or less charged molecules.
That way, molecules of the different sizes will migrate on different rates. And molecules of the same size but with different charges, will migrate on different rates as well.
After a certain period of time, the electrical field is stopped and the gel is removed from the liquid for staining. After staining, the migrating molecules will form "bands" like in this picture below.
Each band represents a different molecule aggregations that either have the same size or charge or both.
Now after getting a general idea of how electrophoresis works, let's move on to mutations.
Mutations are permanent changes in the DNA sequence in general. This change in nucleotide sequence will change the overall charge of the DNA sequence. This change in charge will effect the migration rate in gel electrophoresis, forming different bands than normal, non-mutant DNA sequence.
So you basically take the DNA fragments you want to screen for mutations and run it in a gel electrophoresis against a normal DNA fragment of the same sequence.
Of course, the procedure is not as simple as that but that's the basic gist of it. Check the references for more details.