A given restriction enzyme cuts DNA segments within a specific nucleotide sequence, at what is called a restriction site. These recognition sequences are typically four, six, eight, ten, or twelve nucleotides long and generally palindromic (i.e. the same nucleotide sequence in the 5 – 3 direction). Because there are only so many ways to arrange the four nucleotides that compose DNA (Adenine, Thymine, Guanine and Cytosine) into a four- to twelve-nucleotide sequence, recognition sequences tend to occur by chance in any long sequence. Restriction enzymes specific to hundreds of distinct sequences have been identified and synthesized for sale to laboratories, and as a result, several potential "restriction sites" appear in almost any gene or locus of interest on any chromosome. Furthermore, almost all artificial plasmids include a (often entirely synthetic) polylinker (also called "multiple cloning site") that contains dozens of restriction enzyme recognition sequences within a very short segment of DNA.  This allows the insertion of almost any specific fragment of DNA into plasmid vectors, which can be efficiently "cloned" by insertion into replicating bacterial cells.
After restriction digest, DNA can then be analysed using agarose gel electrophoresis.  In gel electrophoresis, a sample of DNA is first "loaded" onto a slab of agarose gel (literally pipetted into small wells at one end of the slab).  The gel is then subjected to an electric field, which draws the negatively charged DNA across it.  The molecules travel at different rates (and therefore end up at different distances) depending on their net charge (more highly charged particles travel further), and size (smaller particles travel further).  Since none of the four nucleotide bases carry any charge, net charge becomes insignificant and size is the main factor affecting rate of diffusion through the gel.  Net charge in DNA is produced by the sugar-phosphate backbone.  This is in contrast to proteins, in which there is no "backbone", and net charge is generated by different combinations and numbers of charged amino acids.