In order to be caught on one of these many such scams, they include a link to a scam website that resembles Apple's. There, they ask to submit all kinds of personal information Apple would never ask for. Like your Social Security Number.
Either that, or a scammer's phone number to call for assistance with your "problem". They'll then attempt to fleece you out of as much money as you're willing to cough up to fix nothing. On top of that, they'll try very hard to get you to install remote access software. Then you're really in trouble since they may be downloading personal information right off your Mac or Windows computer.
The basic rule here is: There is no software of any kind anywhere in the world that can tell what's on your device through a web browser. Any and all web pages or pop-ups you see like this are 100% lies. You don't even need to think about it. Just close the dumb things.