This is an example 4.4.7 from "Introduction to Mathematical Statistics" by Hogg, McKean, and Craig.
Let $X$ be a random variable of the continuous type with cdf $F_{X}(x)$ and let $\xi_{1/2}$ denote the median of $X$; that is, $\xi_{1/2}$ solves $F(\xi_{1/2}) = \frac{1}{2}$. Now suppose that we take a random sample from this distribution $X_1, \ldots, X_n$ of size $n$ and the corresponding ordered statistics are $Y_1 < Y_2 < \ldots < Y_n$. The sample median $Q_2$ is a point estimator of the distribution median $\xi_{1/2}$.
Now define $\alpha$ so that $0 < \alpha < 1$, and take $c_{\alpha/2}$ to be the $(\alpha / 2)^{th}$ quantile of a binomial distribution $b(n, 1/2) = S$.
The text now states that $P(S \leq c_{\alpha / 2}) = \frac{\alpha}{2}$ and $P(S \geq n - c_{\alpha / 2}) = \frac{\alpha}{2}$. However the textbook also states the median is defined by $\xi _{1/2}$ such that $P(X < \xi_{1/2}) \leq \frac{1}{2}$ and $P(X \leq \xi_{1/2}) \geq \frac{1}{2}$, so why does the textbook state the first two equalities are true or approximately true? Is it because the values of our sample are coming from a continuous distribution?
After the author(s) continue to create the confidence interval for the median.
For a continuous distribution, the probability a single observation exceeds the median is $\frac12$ and the probability it is less than the median is also $\frac12$, while the probability it is exactly the median is zero.
So if you take $n$ i.i.d. observations, the number $S$ which counts how many are less than the median of the distribution is binomially distributed with parameters $n$ and $\frac12$. Your quotation then uses this as the basis of a confidence interval.
To construct a construct a confidence interval for the median, you want the probability of the lower end of the confidence interval being above the median to be no more than than $\frac\alpha 2$, and the probability of the upper end of the confidence interval being below the median also to be no more than $\frac\alpha 2$. That then points to the argument you quote, since you want to base the confidence interval on possible values of $S$ which lead to the desired probabilities of the confidence interval covering the median.