In vaccine trials, participants are divided into two separate groups. One group is given a treatment, while the other group, called the control group is given a placebo. They are then monitored to see how many people in each group develop the condition being studied. For those that develop the condition, we label them YES, and the others are labeled NO. The results are then reported in a contingency table, like the following example:

How does the Hypergeometric distribution come up? For these kinds of experiments, the null hypothesis is that the treatment has no effect. If it is true that the treatment has no effect, then the labeling of “treatment” and “control” is just one of all the random ways the participants can be split into two groups.
Imagine that we wanted to simulate all the different ways that relabeling could occur. In the first row of the sketch below, we have things arranged the way they are presented in the data. Plus signs (+) indicate participants in the YES condition group. Minus signs (-) indicate those in the NO condition group. Under the null hypothesis that there is no difference between the treatment and the control groups, we pool everyone together into a fully mixed population (row 2). We then select half of total population, create a new “treatment” group, and count the number of YES individuals in the randomly labeled treatment group. In the first case, $X$, the number of YES invididuals in the treatment group is 3. But if we run the random relabeling again, we might have $X=4$. Imagine doing this tens of thousands of times. What would the probability distribution of $X$ look like?

When viewed this way, we can see that $X$ has a Hypergeometric distribution. We just have to identify its parameters.
The random variable $X$ can then be interpreted as the number of target individuals (YES condition) among the selected individuals (the treatment group).
