Specifically, how does the p-value depend on effect size and sample size? Are there any other critical factors involved in this relationship?

I'm basically looking to understand how these factors are linked mathematically, via a formula... any ideas?

K.