The p-value condenses a test into a single number measuring how surprising the data is under the null hypothesis.
It gives a common scale for evidence across very different tests.
A smaller p-value means more surprise, and so stronger evidence against the null.
It is found by placing the test statistic on the distribution it would follow if the null were true.
The share of that distribution at least as extreme as the observed result is the p-value.
For a 2-sided test, extremes in both directions count, which roughly doubles the 1-sided value.
The 0.05 threshold is a convention, not a law, and some fields use 0.01 or much stricter levels.
A p-value of 0.049 and one of 0.051 are nearly the same evidence, though one is called significant and the other is not.
The p-value depends on sample size, so huge samples make tiny effects significant.
It also depends on everything going to plan: the test chosen in advance and the data collected as intended.
A p-value is not the probability that the result is due to chance, since it is calculated assuming chance is the only cause.
It is not the probability that the alternative is true either, and 1 minus p is not the chance that the effect is real.
In practice, reporting the size of the effect and its confidence interval beside the p-value lets readers judge importance.
An exact p-value, such as p = 0.003, says more than a bare verdict of significant or not.
The most common misreading is that p = 0.05 means a 5% chance the null is true, which the calculation cannot give.