There is absolutely nothing at all wrong with your iPhone and your iPhone is not infected. Pop-ups can be ads, notices, offers, or alerts that open in your current browser window, in a new window, or in another tab. Some pop-ups are third-party ads that use phishing tactics—like warnings or prizes—to trick you into believing they’re from Apple or another trusted company, so you’ll share personal or financial information. Or they might claim to offer free downloads, software updates, or plugins, to try to trick you into installing unwanted software.
Unless you’re confident of an ad’s legitimacy, you should avoid interacting with pop-ups or webpages that seem to take over your screen. Refer to Article HT203987 for some tips to follow
https://support.apple.com/en-us/HT203987
https://support.apple.com/en-us/HT204759
https://support.apple.com/en-us/HT201265
https://support.apple.com/en-us/HT201355