Compositional gaps are common in volcanic series worldwide. The pervasive generation of compositional gaps influences the mechanical and thermal properties of the crust, and holds clues on how our planet differentiates. We have explored potential mechanisms to generate these gaps using numerical simulations coupling crystallization kinetics and multiphase fluid dynamics of magma reservoirs. We show that gaps are inherent to crystal fractionation for all compositions, as crystal-liquid separation takes place most efficiently within a crystallinity window of ∼50–70 vol% crystals. The probability of melt extraction from a crystal residue in a cooling magma chamber is highest in this crystallinity window due to (1) enhanced melt segregation in the absence of chamber-wide convection, (2) buffering by latent heat of crystallization, and (3) diminished chamber-wall thermal gradients. This mechanical control of igneous distillation is likely to have played a dominant role in the formation of the compositionally layered Earth's crust by allowing multiple and overlapping intrusive episodes of relatively discrete or quantized composition that become more silicic upward.