When current flows, it produces heat. The reason for the switch is so the amp can operate at a lower impedance without incurring damage.
Solid state amps try to produce the same voltage regardless of impedance. As the impedance goes down the current and power increase.
Here is the AC Ohm's Law Formula Wheel.
Assume we have an amp that makes 400W at 8 ohms, 800W at 4 ohms, and 800W at 2 ohms.
Solving for V = sq rt of PZ
At 8 ohms at 400W
V = sq rt of (400 x 8) = ~56.57V
At 4 ohms at 800W
V = sq rt of (800 x 4) = ~56.57V
These answers are rounded to the 100s space, which is why I used "~".
Notice when the impedance is cut in half, the voltage stays the same but the power doubles.
Now lets see what happens with the current by solving for I = sq rt (P/Z)
At 8 ohms and 400W
I = sq rt (400/8) = ~7.07A
At 4 ohms and 800W
I = sq rt (800/4) = ~14.14A
You get the same answer by using I = V/Z
At 8 ohms and 400W
I = ~56.57/8 = ~7.07A
At 4 ohms and 800W
I = ~56.57/4 = ~14.14A
So as you see, the current also doubles when the impedance is cut in half.
Let's calculate the Voltage and Current for 800W at 2 ohms
V = sq rt (800 x 2) = 40V
I = sq rt (800/2) = 20A
Notice that even though the voltage was reduced from ~56.57V to 40V that the current still increased from ~14.14A to 20A
P = E x I
40 x 20 = 800W
With out the switch, the amp would try to maintain the voltage at ~56.57V
I = ~56.57/2 = ~28.29A
P = ~56.57 x ~28.29 = ~1600W.
Unfortunately the amp won't work reliably at this power and current level, so it has to be derated.
Some amps reconfigure the power supply to lower the voltage in the power supply. Some amps adjust a limiter so the drive sent to the output section is kept within a safe range.
FYI, The switch is not new or specific to class-D. This image is from a 70's era Traynor PM-300 power amp:
View attachment 4969934