Statistical Mechanics is the mechanical behavior of a system whose detailed state is unknown, but for which an overall (non-detailed) state can be derived through mathematical probability.
Likely, the original physics problem for which Statistical Mechanics was developed is the behavior of gases, e.g., Boyle's Law or the Ideal Gas Law, modeled as the highly probable result of the interaction of many molecules. Given the large number of molecules in everyday systems (e.g., the air in a room), the "probable" behavior is so probable as to be virtually determined.
Statistical Mechanics was worked out using Classical Mechanics but has been adapted to Quantum Mechanics.
Partition Function (Z)