Affinity Chromatography uses a stationary phase that is designed to bind to a specific molecule in order to isolate that molecule from a mixture. For example, this method is frequently used to purify proteins. The protein we are interested in has to have well-defined properties so that we know what to put into the stationary phase that will bind the protein. Proteins that bind to the packing spend more time in the stationary phase. Proteins that don't bind to the packing spend less time in the stationary phase and so they move through the column more quickly.
For example, if we wish to purify a specific protein, we might use a stationary phase in which a solid resin is bonded to specific peptide chains. These peptide chains would be chosen because we know they bind well to the specific protein of interest; they are good ligands for this protein. When a mixture of proteins is loaded onto the column and washed through with a buffer, only the protein of interest will get stuck on the stationary phase. Everything else should keep moving in the mobile phase.
Unlike some other kinds of chromotography, affinity chromatography is binary. There are only two fractions: the one we want and the one we don't want. The one we don't want comes out as we wash the column with buffer.
To get the fraction we do want, we need to elute the column with an eluting solution. The eluting solution changes the conditions so that the protein we want no longer sticks to the stationary phase. For example, a change in buffer solution may result in some conformational changes that make the protein bind less tightly to its ligand. We collect this fraction of purified protein.
There are other variations on affinity chromatography. For example, antibodies can be purified in this way by bonding complementary antigens to the stationary phase. A peptide or nucleotide sequence might also be used because it binds to DNA or RNA.