Porous electrodes composed of multiphase active materials are widely used in Li-ion batteries, but their dynamics are poorly understood. Two-phase models are largely empirical, and no models exist for three or more phases. Using a modified porous electrode theory based on non-equilibrium thermodynamics, we show that experimental phase behavior can be accurately predicted from free energy models, without artificially placing phase boundaries or fitting the open circuit voltage. First, we simulate lithium intercalation in porous iron phosphate, a popular two-phase cathode, and show that the zero-current voltage gap, sloping voltage plateau and under-estimated exchange currents all result from size-dependent nucleation and mosaic instability. Next, we simulate porous graphite, the standard anode with three stable phases, and reproduce experimentally observed fronts of color-changing phase transformations. These results provide a framework for physics-based design and control for electrochemical systems with complex thermodynamics.