Using Boltzmann’s Vorlesungen über Gastheorie as a guide, we examine the logic and mathematics underlying his theory of statistical mechanics. These are evaluated by comparison with the results generated by ideal gas simulations which instantiate kinetic theory. We make a clear distinction between kinetic theory as a deterministic physical model and statistical mechanics as a probabilistic model. Boltzmann’s formulation of statistical mechanics in Gastheorie is based on the notion that equilibrium is defined by the most probable macrostate and the premise that progression through ever more probable macrostates is the source of the second law of thermodynamics. The realization that statistical macrostates are mental constructs and not physical states renders both of these propositions meaningless. Instead, equilibrium is properly identified as statistical stationarity, an idea originating with Marian Smoluchowski from his studies of Brownian motion. A two-dimensional simulation demonstrates that the second law of thermodynamics is the direct consequence of Newton’s laws of motion and the law of conservation of energy, thereby resolving Loschmidt’s paradox. In addition, a three-dimensional simulation verifies that the Maxwell energy distribution, not the Boltzmann energy distribution, gives the correct allocation of system energy over the molecules.