The amount of money for a given amount of energy spent mining you get is effectively Bitcoin price / difficulty.
If Bitcoin price goes up, then the return on energy gets greater. Therefore, it's worth it to spend more energy mining. Then difficulty rises and takes this incentive away, reaching a new equilibrium with more energy spent.