Hey mate, Apex is a very common cause of the lag you're seeing. You need to find a way to make sure Apex doesn't use all your GPU's power. OBS needs a few % for itself, and Apex will often happily try hog the whole 100%.
Some people have luck by lowering their graphics settings. There is a hard cap in-game at 144 fps, so by lowering the graphics settings, your GPU might now be capable of 160, but will only do 144, therefore leaving some power for OBS to use.
Some people have luck by changing their monitor's refresh rate, then fiddling with V-Sync in-game. If you can lock the game to a lower refresh rate, this will also give OBS what it needs.
You might need to use a tool to monitor in-game fps. I still use Fraps for some reason, I don't know why I haven't upgraded, lazy maybe. But there's plenty of tools that will do it for you.
If you can guarantee that your GPU isn't using 100% on the game, and you have NO render lag, but you still get encoder lag, change the preset in the settings to "medium" or "performance" or something similar.
You can try test with another game that uses less graphics power, to confirm that it is indeed Apex causing your issue.