Math, the same one used to get 95% efficacy.
Lets consider a population of 100,000 people where 80% are vaccinated and 20% are not.
And use the same infection rate in the pfizer mrna vaccine phase 3 trial, a mere 0.8% for the unvaccinated and 0.04% for the vaccinated (0.8 less 0.04 divide by 0.8 was what they meant by 95% efficacy).
In the 80/20 vaccinated 100,000 population, if 0.8% of the unvaccinated (160) are infected, then at 95% efficacy you can expect only 0.04% of the vaccinated (32) to be infected.
This means no more than 32/192 = 16.67% of the cases should come from vaccinated IF vaccine efficacy is 95%.
What happens if 80% of the cases are vaccinated? That gives, if unvaccinated infected remains at 160, vaccinated infected would be 640 (640/total 800 = 80%).
640 out of 80,000 infected is 0.8%, the same as 160 out of 20,000, meaning an efficacy of zero.
What happens if 50% of the cases are vaccinated? That gives, if unvaccinated infected remains at 160, vaccinated infected would be the same 160.
160 out of 80,000 infected is 0.2%, meaning an efficacy of 0.6/0.8 = 75%.