Distillation heats a liquid mixture. The difference in boiling points of similar compounds is primarily related to the mass of the compounds. Thus, the lighter ones vaporize first and exit the distillation flask. Those vapors can then be recondensed into the (relatively) pure liquid compound. A simple distillation will separate two or more compounds into separate collections of each one.