Your intuition is correct here --- although the p-value is not used as a measure of effect size, you are correct that in some tests, for a fixed sample size the distribution of the p-value is monotonically related to the effect size, and thus is implicitly a transformed estimator of the effect size. Generally speaking, a larger effect size (further from the null hypothesis) manifests in a smaller p-value. In many cases it is possible to establish a stochastic dominance result to this effect.
Example - One sample two-sided Z-test: To illustrate this phenomenon, consider the simple case where we have IID normal data and we take a one-sample Z test of the population mean $\mu \in \mathbb{R}$ with known population variance $\sigma = 1$. (This is not a very realistic scenario, but it is the simplest version of the hypothesis test for a mean, so it is useful for illustrative purposes.) Taking a two-sided test with null hypothesis $H_0: \mu = \mu_0$ we have the test statistic:
$$Z(\mathbf{x}_n) = \sqrt{n} \cdot (\bar{x}_n - \mu_0),$$
with the corresponding p-value function $p(\mathbf{x}_n) = 2 \cdot \Phi(-|Z(\mathbf{x}_n)|)$. If the true mean is $\mu$ then the absolute value of the test statistic has a folded normal distribution:
$$|Z(\mathbf{X}_n)| \sim \text{FN} \Big( \sqrt{n} \cdot (\mu - \mu_0), 1 \Big).$$
Now we apply the standard rules for transformations of probability density functions to obtain the the p-value density function. The transformation $p = 2 \Phi(-z)$ has inverse $z = - \Phi^{-1} (p/2)$, so we get:
$$\begin{align}
f(p)
&= f(z(p)) \times \Bigg| \frac{dz}{dp} \Bigg| \\[6pt]
&= \text{FN} \Big( - \Phi^{-1} (\tfrac{p}{2}) \Big| \sqrt{n} \cdot (\mu - \mu_0), 1 \Big) \times \Bigg( \frac{1}{2} \cdot \frac{1}{\text{N}(\Phi^{-1} (\tfrac{p}{2})|0,1)} \Bigg) \\[6pt]
&= \frac{1}{2} \cdot \frac{\exp \big( -\frac{1}{2} \cdot (- \Phi^{-1} (\tfrac{p}{2}) - n (\mu - \mu_0)^2)^2 \big) + \exp \big( -\frac{1}{2} \cdot (- \Phi^{-1} (\tfrac{p}{2}) + n (\mu - \mu_0)^2)^2 \big)}{\exp \big( -\frac{1}{2} \cdot (-\Phi^{-1} (\tfrac{p}{2}))^2 \big)}. \\[6pt]
\end{align}$$
As you can see, the distribution of the p-value depends on the population mean $\mu$. With some more algebra, it can be shown that the distribution of the p-value is "stochastically dominated" as $|\mu - \mu_0|$ increases (i.e., the p-value tends to get smaller in this case).