Yes. This is how it was explained to me—and I'm no engineer. The engineers developed a look-up table that is looking at different things. It's looking at the workload that the user is putting on it. Are they watching something or playing games? Then they're looking at the ambient room temperature.
Now, I mentioned cold temperatures, but the iPhone device will also shut off if it's extremely hot. That's a safety feature that's always existed. It's looking at ambient room temperature. It's looking at the chemical age of the battery, as batteries do age. Then it's looking at the charge status of the battery. It's dynamically operating, and as you said exactly, it's shifting energy in some place to compensate for something else. If it changes, it changes.
It's also really important to say that this doesn't happen to everybody all the time.