In the Pfizer trial the outcome measured was positive PCR test PLUS multiple symptoms of covid.
Of the 20,000 people in the control group approximately 190 people were flagged as "positive cases with multiple symptoms" and in the vaccinated group of 20,000 it was only 8 or 9 people.
In normal conditions this sort of trial would need to be repeated several times in order to ascertain the "true" efficacy, however on the basis of the one trial the vaccine was given emergency approval.
95% efficacy comes from dividing the number of disease cases (as defined above)in the vaccine group by the number of disease cases in the control group, which works out around 0.05%. Subtracting this from 1 gives 0.95 (i.e. 95% efficacy).
It means that there were fewer people who got covid and multiple symptoms in the vaccinated group than the control group, but it absolutely does not mean that it prevented 95% of vaccinated people from catching covid, or from getting severe symptoms.
99% of the control group (without covid vax) were flagged as NOT "positive cases with symptoms" in the trial. In the vaccinated group it was much closer to 100%.
Even though this is evidence that the vaccine has some "efficacy", it was based on the very small number of 200 "positive cases with symptoms" out of a total of 40,000 people.
It is not correct to equate efficacy with likelihood of not catching covid.
It is not right to think that an unvaccinated person is infectious simply be nature of being unvaccinated. And it is not right to think that 95% of vaccinated people are "safe" to hang out with. This is not what efficacy means.
www.thelancet.com/journals/laninf/article/PIIS1473-3099(21)00075-X/fulltext