Understanding collective human behavior and dynamics at urban-scale has drawn broad interest in physics, engineering, and social sciences. Social physics often adopts a statistical perspective and treats individuals as interactive elementary units, while the economics perspective sees individuals as strategic decision makers. Here we provide a microscopic mechanism of city-scale dynamics, interpret the collective outcome in a thermodynamic framework, and verify its various implications empirically. We capture the decisions of taxi drivers in a game-theoretic model, prove the existence, uniqueness, and global asymptotic stability of Nash equilibrium. We offer a macroscopic view of this equilibrium with laws of thermodynamics. With 870 million trips of over 50k drivers in New York City, we verify this equilibrium in space and time, estimate an empirical constitutive relation, and examine the learning process at individual and collective levels. Connecting two perspectives, our work shows a promising approach to understand collective behavior of subpopulations.