Solid state physics is concerned with the measurable properties of systems consisting of many particles, particularly when the systems are in thermal equilibrium. Such macroscopic properties emerge from the system's microscopic dynamics through a process of averaging.
Measured quantities reflect weighted averages over all of the microscopic degrees of freedom.
The partition function allows us to calculate the necessary averages. How to interpret the averaging process differs subtly between quantum and classical systems. This difference can be quite confusing at first. We'll try to avoid getting confused by starting out with a classical treatment and then distinguishing it from a quantum treatment.