  We present a thermodynamic theory for a generic population of $M$ individuals
distributed into $N$ groups (clusters). We construct the ensemble of all
distributions with fixed $M$ and $N$, introduce a selection functional that
embodies the physics that governs the population, and obtain the distribution
that emerges in the scaling limit as the most probable among all distributions
consistent with the given physics. We develop the thermodynamics of the
ensemble and establish a rigorous mapping to thermodynamics. We treat the
emergence of a so-called "giant component" as a formal phase transition and
show that the criteria for its emergence are entirely analogous to the
equilibrium conditions in molecular systems. We demonstrate the theory by an
analytic model and confirm the predictions by Monte Carlo simulation.
