The formula refers to the binomial distributions. Remember most of statistical inference is essentially proof by contradiction. In the null you assume what you want to contradict and start reasoning from there. Though I note that we lay out how we will do so before observing the data to avoid reasoning that is essentially multiple testing in disguise. As you can see though from this example people often do hand waving in that department. If they stick to "known" test quite often they decide how they will test after they see the data. Strictly speaking that is "bad". Anyway back to the point.
If the null is that the median is 20 what is the probability that the next observation is over the median? Under the median? Theres a .50 probability that observations are over or under the median for any unknown distribution. Its part of the definition of median. If you observe more observations over your hypothesised median than not you start to gather evidence to contradict that the median is what you assumed under the null.
The actual formulas are just the binomial distribution formulas.