Hey there! Most likely you have adware installed that was either downloaded unintentionally, or transferred from a previous backup. As I’ve never seen this behavior from a marketing standpoint from Apple.
However, can you confirm which web browser you’re using? I know Chrome as some others are more susceptible to malware than Safari is, but no browser is immune, depending on how it is used.
This is an article Apple provides if this is the case:
About pop-up ads and windows in Safari:
https://support.apple.com/en-us/HT203987
Another outdated article I like has some information that may also still be relevant:
How to avoid or remove Mac Defender malware in Mac OS X v10.6 or earlier:
https://support.apple.com/en-us/HT202225
Some things still apply such as removing Login Items of such software, etc.
Nowadays with SIP and Gatekeeper updates, just restarting and keeping the OS up to date is sufficient.
However I, personally, have found Malware Bytes for Mac to be a good and effective tool if some still remains. There is a a free version you can use as well, this may save you some time trying to find the culprit:
https://www.malwarebytes.com/mac/
If it’s due to something else, apologize, just a hunch, but hope that helps out!