Observed versus expected frequencies
The chi-square test starts with a contingency table comparing what you actually counted (observed) against what theory predicts (expected) if the variables were unrelated. If a coin is fair, you expect 50 heads and 50 tails in 100 flips; observed results rarely match exactly.
The test quantifies the mismatch and asks whether it's large enough to reject the null hypothesis that the two variables are independent. A tiny chi-square value suggests the data aligns with randomness; a large value suggests a real relationship.
Interpreting the distribution and verdict
The chi-square distribution (a right-skewed, non-negative distribution) shows the probability of observing your test statistic under the null hypothesis. The diagram overlays a vertical line at your computed chi-square value and shades the rejection region at the tail, where unlikely values cluster.