I'm not sure what the question is here.

BUT the p-value is determined by the ALTERNATIVE hypothesis and the test stat.

In testing a mean with say > in the alternative and test stat say 2.

Then the p-value is assuming we know sigma or are approximating with the central limit theorem

IF you have a two sided test, say and a test stat of 2 again then the p-value is

Basically the p-value is the probability of being WORSE off than the test stat in any setting.