Detergents are amphipathic compounds with a nonpolar, hydrophobic tail and a polar, hydrophilic head group. Due to these structural features detergents tend to aggregate into structures called micelles at high enough concentration; arranging themselves with their hydrophobic tails pointed inwards and their hydrophilic heads pointed outwards. Detergents come in three types: ionic (cationic and anionic) and non-ionic. Non-ionic detergents aren’t generally used for gel electrophoresis due to their limited ability to break non-covalent interactions between protein residues and inability to impart a uniform charge onto the protein. Ionic detergents (typically anionic SDS) are used for gel electrophoresis as they are highly useful for protein solubilization, linearization and for establishing a uniform charge in preparation for gel electrophoresis.
Proteins consist of stretches of hydrophilic and hydrophobic residues which generally fold in such a way that hydrophobic residues are buried in the interior of the protein and hydrophilic residues are on the exterior of the protein. This tendency of proteins allows for cytoplasmic proteins to dissolve into the aqueous environment of the cell, but membrane proteins, who typically have exposed hydrophobic sites that allow them to bind to or integrate into the lipid bilayer of the cell, are not typically readily soluble. It is, therefore, the detergent’s job to assist in denaturing the protein and by doing so increase its solubility. The hydrophobic tail of a detergent stabilizes any hydrophobic residues present in the protein and the hydrophilic head disrupts any non-covalent bonds between residues to unfold the protein.
That’s not all, detergents are responsible for in gel electrophoresis; they are also responsible for imparting a uniform charge across the length of the protein. If the charge was not uniform then different proteins in the sample would migrate at different rates from the applied voltage due to differing amounts of charge on each protein in the sample. This effectively makes the proteins migrate as a function of their size AND charge, therefore rendering the assay a much less useful tool. Ionic detergents act by masking the differing charges across all proteins in solution by applying a comparatively much larger net negative (in the case of an anionic detergent) charge across the whole of the protein. By doing this all of the proteins in the sample will have essentially a uniform charge and all migrate at the same rate with respect to their charge, thus allowing only protein size to be the separating factor.