A theoretical description of the two-pulse phase-modulated (TPPM) decoupling sequence in magic-angle spinning NMR is presented using a triple-mode Floquet approach. The description is formulated in the radio-frequency interaction-frame representation and is valid over the entire range of possible parameters leading to the well-known results of continuous-wave (cw) decoupling and XiX decoupling in the limit of a phase change of 0° and 180°, respectively. The treatment results in analytical expressions for the heteronuclear residual coupling terms and the homonuclear spin-diffusion terms. It also allows the characterization of all resonance conditions that can contribute in a constructive or a destructive way to the residual linewidth. Some of the important resonance conditions are described for the first time since they are not accessible in previous treatments. The combination of the contributions from the residual couplings and the resonance conditions to the effective Hamiltonian, as obtained in a Floquet description, is shown to be required to describe the decoupling behavior over the full range of parameters. It is shown that for typical spin system and experimental parameters a C13 linewidth of approximately 12Hz can be obtained for TPPM decoupling in an organic solid or a protein. This is a major contribution to the experimentally observed linewidths of around 20Hz and indicates that decoupling techniques are still one of the limiting factors in the achievable linewidths.