Under the alternative the t statistic is not t-distributed but noncentral t: T = (Z + λ) / √(V/ν) with noncentrality λ = d√n (one-sample or paired, n pairs) or λ = d√(n/2) (two groups of n). The power is the probability that T falls in the rejection region |T| > t1−α/2,ν, the shaded area under the teal curve. Four quantities are tied together: sample size, effect size d, level α and power; fix three and the fourth follows. The normal approximation n ≈ k(z1−α/2 + z1−β)2/d2 (k = 1 paired, 2 per group) is a little too optimistic.
pwr.t.test values 0.1848496, 0.3031649, 99.08 and 51.01.