A p-value comes up any time you need to judge whether an observed difference or association is likely due to chance or reflects a real effect.