I want to estimate the impact of an independent variable x (lets say a social program) on the dependent variable y (lets say test results) using a social experiment. I understand all inputs needed to calculate the required sample size to test for differences in outcomes y if lets say half of the sample receives the social program and the other half does not.

My question: this seems to be independent of the total population which in the end should then benefit from program x. If this is true, what is the explanation for this? (as sample size calculations for means of a population do require some knowledge about the size of the population)

Thanks a lot!