  Composition schemes are ubiquitous in combinatorics, statistical mechanics
and probability theory. We give a unifying explanation to various phenomena
observed in the combinatorial and statistical physics literature in the context
of~$q$-enumeration (this is a model where objects with a parameter of value $k$
have a Gibbs measure/Boltzmann weight $q^k$). For structures enumerated by a
composition scheme, we prove a phase transition for any parameter having such a
Gibbs measure: for a critical value $q=q_c$, the limit law of the parameter is
a two-parameter Mittag-Leffler distribution, while it is Gaussian in the
supercritical regime ($q>q_c$), and it is a Boltzmann distribution in the
subcritical regime ($0<q<q_c$). We apply our results to fundamental statistics
of lattice paths and quarter-plane walks. We also explain previously observed
limit laws for pattern-restricted permutations, and a phenomenon uncovered by
Krattenthaler for the wall contacts in watermelons.
