It's called "Oh crap, I'm on the battery, better start conserving energy!". If you really don't care about battery life while playing games, you have to do two things:
In NVIDIA control panel- Go to 3D Settings → Manage 3D settings. Make sure you're on the "Global" tab
- Scroll down until you find "Power Management"
- On the right column, click on it and select "Prefer Maximum Power"
In Windows- Go to Control Panel → Power Options → Click on "Change Plan Settings" on the power plan you want to configure this for → Click on "Change advanced power settings"
- In the advanced power settings, click on "Change settings that are currently unavailable" (if it's there)
- Scroll down to "PCI-Express", expand it to get to "Link State Power Management", expand that
- In the settings, set it to "Off"
And it may just be a firmware feature, which is out of your control.