Solitons and breathers are localized solutions of integrable systems that can be viewed as “particles” of complex statistical objects called soliton and breather gases. In view of the growing evidence of their ubiquity in fluids and nonlinear optical media, these “integrable” gases present a fundamental interest for nonlinear physics. We develop an analytical theory of breather and soliton gases by considering a special, thermodynamic-type limit of the wave-number–frequency relations for multiphase (finite-gap) solutions of the focusing nonlinear Schrödinger equation. This limit is defined by the locus and the critical scaling of the band spectrum of the associated Zakharov-Shabat operator, and it yields the nonlinear dispersion relations for a spatially homogeneous breather or soliton gas, depending on the presence or absence of the “background” Stokes mode. The key quantity of interest is the density of states defining, in principle, all spectral and statistical properties of a soliton (breather) gas. The balance of terms in the nonlinear dispersion relations determines the nature of the gas: from an ideal gas of well separated, noninteracting breathers (solitons) to a special limiting state, which we term a breather (soliton) condensate, and whose properties are entirely determined by the pairwise interactions between breathers (solitons). For a nonhomogeneous breather gas, we derive a full set of kinetic equations describing the slow evolution of the density of states and of its carrier wave counterpart. The kinetic equation for soliton gas is recovered by collapsing the Stokes spectral band. A number of concrete examples of breather and soliton gases are considered, demonstrating the efficacy of the developed general theory with broad implications for nonlinear optics, superfluids, and oceanography. In particular, our work provides the theoretical underpinning for the recently observed remarkable connection of the soliton gas dynamics with the long-term evolution of spontaneous modulational instability.