Hollow Knight will lag or freeze if there are a lot of apps running in the background. You can try to disable all apps in the background to attain fluid gameplay. Also, make sure that there is no overlay app running in the background, V-sync is disabled, and you are running the game on a dedicated GPU.