Michael Lew's answer mentioned partly about the criticism pertinent to the definition of $p$‐value, but didn't expound on that point (which is okay as the answer was addressing from a different pov with an alternate interpretation in tandem with the mathematical definition).
For the sake of argument, as OP raised a reasonable objection, it is deemed apt to address how the very dependence on extreme values which actually haven't been observed somewhat befuddles using $p$–value as "strength of evidence" against a (null) hypothesis.
It is known from the law of likelihood that the evidence associated with an observation $\mathbf X=\mathbf x$ concerning the hypothesis $\mathrm H_0:\theta=\theta_0$ vis-à-vis $\mathrm H_1:\theta=\theta_1$ is $f(\mathbf x;\theta_0) /f(\mathbf x;\theta_1); $ no other information -- whether thhose being the possible values of $\mathbf X$ that have not been realized or any other aspect -- should not be relevant for measuring the evidence for $\mathrm H_0$ vis-à-vis $\mathrm H_1.$
This leads to the principle of irrelevance of the sample space: consider an experiment involving tossing of a coin $20$ times to gather evidence about the possible value of $\theta, $ the probability of heads appearing in a toss. There are two investigators: $A$ and $B$. The result of the experiment is reported as the total number of heads obtained to $A$ while $B$ only gets to know whether the number of heads is $6$ or not.
When the experiment results in $6, $ the evidence concerning $\mathrm H_0:\theta=\theta_0$ vis-à-vis $\mathrm H_1:\theta=\theta_1$ is same for both $A$ and $B;$ that is the likelihood ratios for both the investigators are same: $\theta_0^6(1-\theta_0)^{14}/\theta_1^6(1-\theta_1)^{14}.$ Had the experiment reulted in a different number of heads other than $6, $ the evidence obtained would be different for each investigators. But that is irrelevant now that the realized observation is $6.$
As Royall in $[\rm I]$ writes (emphasis mine):
Although the scientific community might reasonably have chosen to subscribe to [$A$] in preference to [$B$], on the grounds that [$A$] could promise to provide a more detailed description of the observation under most circumstances, for the result that actually occurred, six heads, [$B$'s] report is equivalent, as evidence about $\theta,$ to [$A$'s]. Any concept or technique for evaluating observations as evidence that denies this equivalence, attaching a different measure of ‘significance’ to [$A$] of this result than to [$B$], is invalid. Whatever can be properly inferred about $\theta$ from [$A$] can be inferred from [$B$] and vice versa. The difference between [the two] sample spaces is irrelevant. ... The ‘irrelevance of the sample space’ is a critically important concept, for it implies a structural flaw that is not limited to significance tests, but pervades all of today’s dominant statistical methodology.
That is, a proper measure of evidence should not depend on the probabilities of unrealised "extreme" values. But $p$–value relies on the probabilities of those very extreme outcomes which didn't occur.
This does impact the prospect of using $p$–value as a measure of evidence.
Suppose in the above experiment $\rm H_0: \theta=0.5 $ and $\rm H_1:\theta<0.5.$ The test statistic is the total number of heads and small values would be considered extreme as they would be implausible under $\rm H_0.$ When $\rm x=6, $ both $A$ and $B$ would have the same information as the prior probability ratio $\Pr(\rm H_0) /\Pr(H_1) $ would be increased by $f(6;0.5) /f(6;\theta_1). $ However the $p$–value would be different:
in case of $A:$ $$\Pr[6~\textrm{or less number of heads}\mid \theta=0.5]=0.06, $$
in case of $B:$ $$\Pr[6\mid \theta=0.5]=0.04,$$ since for $B$ in $\{6, ~\text{not}~6\}, $ the extreme event is $6.$
This leads to an illogical conclusion:
The $p$–values assert (incorrectly) that the outcome (six heads in $20$ tosses) is stronger evidence against $\rm H_0$ (in favor of $\rm H_1$) for [$B$] than it is for [$A$].
Royall, in that vein, writes:
The significance-test approach to measuring the evidence is wrong because its dependence on the sample space leads to different answers in situations where the evidence is the same. That is, it violates the principle of the ‘irrelevance of the sample space’.
Perhaps more compelling is what Jeffreys stated:
... a hypothesis which may be true may be rejected because it has not predicted observable results which may have not occured.
--
References:
$\rm[I]$ Statistical Evidence : A Likelihood Paradigm, Richard M. Royall, Chapman& Hall, $1997,$ sec. $1.11, 3.4.$
$\rm[II]$ Introductory Statistical Inference with the Likelihood Function, Charles A. Rhode, Springer International, $2014, $ sec. $5.3.$