It is driven by the torque based tuning in the car.
Here is what I wrote a while ago. Probably more than you wanted to know . .. but what the heck
There is a very lengthy post on this subject. Westers did a write up on the GMPP tune and what it does and does not do to the car.
The way the code is written in the ECM, the 2.0 is torque managed. The factory tune manages the engine parameters to produce 260 ft pounds of torque. The horse power is a result of achieving that torque value.
If you add hardware that is capable of producing torque values (and resultant HP) above the 260 ft pounds target, the ECM will "learn down" to achieve 260 ft pounds.
Basically, there are a set of data tables that are fixed. And there is memory that is controlled by the ECM. The fixed parameters cover all the possible variables, timing, fuel, air, boost, cam timing etc. It’s more complicated than that but conceptually you get the idea.
The ECM is constantly looking at all the sensors it has available. It is constantly "learning up and learning down" the various parameters it can control to maintain what it believes to be the settings that produce 260 ft pounds of torque.
It’s not strictly learning down because the ECM is constantly varying in real time the engine parameters it controls. What is really happening is the ECM is choosing specific settings from the pre-programmed tables for timing, fuel, air, boost, cam timing etc. based on near real time calculations. The calculations include throttle pedal setting, ambient temperature, air flow rates, O2 sensor readings etc.
The ECM "remembers" where it is at in each of the data tables. It "learns" where it is in each of the tables as it changes its mind on where to pull the settings from the tables based on current sensor readings. It does not create data per se, it uses the data it has in the tables but changes where it pulls the data in the tables based on a set of rules programmed into the ECM operating system.
Since the ECM can react faster than the mechanical systems it is managing, there is a built in time constraint on how much it can change its entry points into each of the data tables. The time constraint is a real time - mille seconds for some setting changes and key cycles for others.
Typically when you are running an unmodified car, when you start the car it "remembers" where it was when it was shut down and begins with that location as the current setting. It looks at the MAF to update air density and watches the O2 sensors to make sure it’s managing the settings. But it does not make any big changes when you start the car. It is making small "make play" environmental changes to optimize the startup and initial running experience. It may make small changes during that run cycle but is constrained to making small changes per run cycle.
If you bolt on a piece of hardware that can produce 10+ hp, the ECM makes small adjustments per its constraints, but it will experience an increase in torque measured because of the hardware update. It will adjust the engine parameters to avoid damage - that is crank up the fuel to avoid lean runs and vary the timing to avoid knock. So you may see the 10 hp increase for that cycle.
When you shut the car off and restart it - executing one key cycle - the ECM will recognize that it is producing MORE than the target of 260 ft. pounds and will crank down the parameters it controls as much as it can in that key cycle. Over the course of 5-6 key cycles, the ECM will be incrementally adjusting the engine parameters to get back to the ideal 260 ft pounds. After 5-6 key cycles, with each cycle resulting in the maximum "learn down" allowed, the car will be producing 260 ft pounds of torque. Again the HP is a product of producing the value that results from the ECM setting parameters.
The GMPP tune provides a new set of data tables and a new entry point in those tables. The new tables allow more growth in torque (much higher limit for "learn down") and they change the baseline starting point in the tables to the settings that are predicted to produce 340 ft pounds of torque. At that baseline torque, the resultant HP is about 290. There is some variability in HP measured for different cars because there are detail differences in the hardware across the sample set.
All tunes do basically the same thing. They change some of the values in the existing data tables. No tune will support unlimited HP growth because the physical size of the data tables is limited. All have an "edge" somewhere that forms the practical limit for power growth. The GMPP tune and the Westers tune all change the key parameter values in the tables to produce the desired result.