If it is an app, which seems likely, it's running in the background and you won't necessarily have to have an app running to see the ads.
Try safe mode. If it goes away in safe mode it will point to an app as the culprit. You'll have to try uninstalling things until it stops.
"Steps to Restart your Samsung Galaxy S8 in Safe mode
Turn on and use safe mode
Safe mode allows you to turn on the device with third-party apps disabled. Then you can easily uninstall apps that may be causing a conflict or software problem.
Turn the device off.
Press and hold the Power key past the model name screen.
When "SAMSUNG" appears on the screen, release the Power key.
Immediately after releasing the Power key, press and hold the Volume down key.
Continue to hold the Volume down key until the device finishes restarting.
Safe mode will display in the bottom left corner of the screen.
Release the Volume down key when you see Safe Mode.
Uninstall apps that are causing a problem.
Turn off safe mode
Press and hold the Power key.
Tap Restart."
https://www.getdroidtips.com/reboot-samsung-galaxy-s8-safe-mode/