As the air density decreases, the fuel/air ratio to maintain rpm remains about constant, and so the fuel control (be it hydromechanical or electronic) gradually trims back fuel to hold rpm.
Thus with lower mass flow (lower density air) the thrust of course decreases. Usually the most critical point in the transport mission (thrust required compared to thrust available) is at top of climb.