Safari doesn’t block anything unless you enable restrictions. It blocks cross-site tracking if you enable that feature, meaning that if you click on a site selling men’s pants other sites selling men’s pants won’t know about it. That’s what cross-site tracking does. Scam pop-ups are just ads that appear on legitimate sites. Some sites are better than others at vetting their advertisers. But except for the very largest companies most web sites don’t manage their own ads; they contract with ad placement services, many of whom are not discriminating about whose ads they post, as long as the advertiser pays them.
While on the whole I don’t like Google ad placement services, they are pretty good at keeping the dreck off the sites that contract with them.