They know the density of holeless cheese, and can compare to the sample. If it's underweight it probably has holes?
Eureka!