I made a simple landscape and put in a few nanite trees (less than 10) and the viewport runs at ~5fps. I even packaged the game to see if it was due to it being in the editor and it still couldn’t run at more than ~5 frames.
So I checked task manager, and it showed my CPU and GPU usage both at less than 10%.
Unreal Engine will use resources based on what it needs to run the game smoothly. Obviously you are experiencing some issues here; it almost sounds as if your system is running the game using the background lag. Usually when you are tabbing out of the engine or game, it reduces the resources it is using significantly. Perhaps this is triggered when you are working in the engine, even though the window is focused?
In any case, I suggest looking at these things:
Make sure that your project settings are optimized for performance. In particular, check the Scalability Settings and make sure that they are set to the appropriate level for your hardware. You can also try disabling any unnecessary features, such as motion blur or ambient occlusion, to see if that improves performance.
Make sure that your rendering settings are optimized for performance. In the Editor, go to Edit > Project Settings > Rendering and check that the settings are appropriate for your hardware. You can also try reducing the screen percentage or resolution to see if that improves performance.
Make sure that your level settings are optimized for performance. In the World Settings panel, check the Lightmass settings and make sure that they are appropriate for your hardware. You can also try reducing the number of objects in your scene to see if that improves performance.
Use the Unreal Engine profiling tools to identify any performance bottlenecks in your scene. You can use the Unreal Engine profiler to identify which parts of your scene are taking the most time to render, and optimize those areas to improve performance.
If you have any time to download the Lyra project, I can help you benchmark against my machine which is way worse than yours. I get about 40-50 FPS on high graphics in the game with this hardware: