Mechanics of compressive stress evolution during thin film growth