NNT is calculated using other epidemiological calculations:
Control Event Rate (CER) - Proportion of the control group with the outcome
Experimental Event Rate (EER) - Proportion of the treatment group with the outcome
|CER - EER| is the Absolute Risk Reduction (ARR) or the effect of the treatment in comparison to a control treatment.
Then, in order to calculate NNT, just use (1/ARR).
With smaller values of ARR, or small treatment effects, the NNT will increase meaning that more people have to be treated to prevent a future bad outcome. Higher values of ARR show a strong treatment effect, fewer people will have to be treated to prevent a bad outcome because it is so efficacious.