At the heart of classical thermodynamics is the Boltzmann-Gibbs entropy:
This has a maximum when all states pi have equal probability.
If we apply two simple constraints (normalization and mean value of the energy):
We obtain the distribution function: