Starting from a fully quantized Hamiltonian for an ensemble of identical emitters coupled to the modes of an optical cavity, we determine analytically regimes of thermal, collective anti-bunching and laser emission that depend explicitly on the number of emitters. The lasing regime is reached for a number of emitters above a critical number-which depends on the light-matter coupling, detuning, and the dissipation rates-via a universal transition from thermal emission to collective anti-bunching to lasing as the pump increases. Cases where the second order intensity correlation fails to predict laser action are also presented.