The latest example in the excerpt is a large sample test concerning a single population proportion.
Let's discuss briefly the framework involved in a generalized manner:
The null hypothesis is $\mathcal H_0: p=p_0$ and the alternative hypothesis $\mathcal H_1$ can be one-sided $p\lessgtr p_0$ or both sided $p\ne p_0.$
The test statistic is $\frac{\sqrt n\left(\hat p-p_0\right)}{\sqrt{p_0(1-p_0) }},$ which under $\mathcal H_0$ follows $\mathsf N(0, 1).$
The probability of type II error for $\mathcal H_1: p=p_1 ~(p_1> p_0)$ is
\begin{align}\beta(p_1)&= \Pr\left(\frac{\sqrt n\left(\hat p-p_0\right)}{\sqrt{p_0(1-p_0) }}\leq z_\alpha\mid \mathcal H_1\right)\\&= \Pr\left(\frac{\sqrt n\left(\hat p-p_1+p_1-p_0\right)}{\sqrt{p_0(1-p_0) }}\leq z_\alpha\mid \mathcal H_1\right)\\ &= \Pr\left(\frac{\sqrt n(\hat p-p_1)}{\sqrt{p_1(1-p_1)}}+\frac{\sqrt n(p_1-p_0)}{\sqrt{p_1(1-p_1)}} \leq z_\alpha\cdot\sqrt{\frac{{p_0(1-p_0)}}{{p_1(1-p_1)}}}\mid \mathcal H_1\right)\\&=\Phi\left(\frac{\sqrt n(p_0-p_1)+ z_\alpha\sqrt{p_0(1-p_0)}}{\sqrt{p_1(1-p_1)}}\right);\end{align} note that in the above calculation, the fact that under $\mathcal H_1,~\frac{\sqrt n(\hat p-p_1)}{\sqrt{p_1(1-p_1)}}\sim \mathsf N(0,1)$ was used, as per the definition of $\beta.$
In fact, as noted in $\rm[I], $ the other probabilities of type II errors can be similarly calculated:
--
Reference:
$\rm[I]$ Lecture 14: Tests for a population proportion $p,$ MSU-STT $351$–Sum$19\rm A,$ [link].