On the Foundations of Statistical Mechanics: Ergodicity, Many Degrees of Freedom and Inference