Most physical systems are not isolated, bu exchange energy with the environment. Since the system is very small compared to the environment, we consider that the environment acts effectively as a heat reservoir or heat bath at a fixed temperature . If a small system is put in thermal contact with the heat bath, it will reach thermal equilibrium exchanging energy until the system attains the temperature of the bath.
Imagine an infinitely large number of mental copies of the system and the
heat bath. The probability that the system is found in a microstate
with energy is given by:
We can use (276) to obtain the ensemble average of physical
quantities of interest. For instance, the mean energy is given by: