The DNA from PCR is placed into wells of agarose gel and a buffer solution is poured over it. An electrical current is passed through the gel due to the conduction of the buffer solution. The DNA fragments move towards the positive elctrode because they are negatively charged. Shorter DNA fragments travel further through the gel as they move faster, seperating the DNA by its length.