does it come in when you go over a certain rpm or do the valves change depending on how far you depress the throtle?
The variable is the valve timing. The spark plug fires a split second before the piston reaches the top of the stroke, to give the fuel a bit of time to burn. But, the faster the piston travels in the bore, that split second gets shorter shorter. So the engine computer changes when the spark plug fires when the valves close, to maximize the power from each ignition stroke.