You have to go into Nvidia control panel > Manage 3d Settings > Then Change "Preferred Graphics Processor" from "Auto Select" to "High-Performance Nvidia processor" > Click Apply.
As the-pi-guy said, it's for battery life. Most of the time, it should auto switch when detecting the game but sometimes, it doesn't so you have to manually do it. It's important to switch back to auto select if you want a good battery life however.
PC Specs: CPU: 5950X || GPU: Strix 4090 || RAM: 32GB DDR4 3600 || Main SSD: WD 2TB SN850