They don't block JavaScript, they block the loading of resources deemed to be for advertising. These are typically ads, but they can also be images, CSS, or other resources hosted by advertisers. Such blocking will also block any other kind of tracking done by the external domain.
On the other hand, JavaScript inline in the page is almost never blocked by users.
Telemetry-specific Javascript on the other hand is prevented from executing by many ad blockers, for good reasons.