Sample size is crucial because it affects the test's ability to detect significant differences between groups. A larger sample size increases the precision of the estimates and the likelihood of detecting a true effect, while a smaller sample size may lead to inconclusive or unreliable results.