I had been an iPhone user for over 10-Years. Last year, I fell in love w/ the S9, and Android. Turned in my iPhone for a brand new Galaxy S9. Here is what happended next:
I only use my phone for productivity, and have only productivity apps on it. No games. No Netflix. I do not download unknown or unfamiliar apps. Of couse, no porn also. Despite this, my S9 was overrun with ads...some ads even prevented me from answering telephone calls. I used five ad-blockers, used the ad-block browser, and used five-antivirus/maleware programs...at the same time. Not one of these solutions helped me. I searched the web for other solutions, to no avail. It seems I am not alone in this experience. In any event, I gave up, and went back to the iPhone...The new iPhone XS Max is pretty phenomal, in case you were wondering.
When a person is getting unwanted ad's I suggest to put the phone in Safe Mode which disables all the downloaded apps and leaves the stock ones working which can help determine if this was an app.
If it stops in Safe Mode then it's a case of uninstalling the apps one at a time.
The stock apps do not typically have ad's written into them.
A person does not have to visit adult / streaming sites etc to be hit by adverts.
It's always beneficial to be wary if sideloading via an Apk file which is why the phone blocks these out of the box and has to be circumvented by the owner of the phone to allow them.
Yes the iPhone you mention is an impressive device which just does things simply however for me iPhones and iOS is way too sandboxed for my liking and I'd miss the freedom to have my phone the way I want it and not the way Apple wants me to have it set up etc.
Each to their own.
Current Phone ~
Samsung Note 20 Ultra 5G SM-N9860_256Gb SnapDragon 865+
Samsung One Ui 3.1/ Android 11.
What you experienced is something I have never seen myself, its a result of installing some "bad" apps and the only way around it is uninstalling the app that did it. Worst case scenario it can be solved by a factory reset. Its indeed a downside that comes with having freedom over your phone (as opposite to an iPhone which is a closed platform).
Hopefully our advice will help with allowing you to enjoy your phone again. The S9 is a marvelous device and its a shame to be thrown away due to some bad apps.