Let $\mathbf{X} = (X_1, \ldots, X_n)$ be an i.i.d sample from the parametric family of distributions $\mathcal{P} = \{P_\theta: \theta \in \Theta \subset \mathbb{R}^k\}$ ($X_i \sim P_\theta$ are random variables, not just real numbers). In my statistics textbook there is the following formula for the Maximum Likelihood Estimator $\hat\theta(\mathbf{X})$ (which is also a random variable, not an estimate):
$$\hat\theta(\mathbf{X}) = \underset{\theta \in \Theta}{\operatorname{argmax}} L(\mathbf{X}; \theta),$$ where $L(\mathbf{X}; \theta)$ is a random variable which is obtained from an ordinary (numerical) likelihood function $L(\mathbf{x},θ)$ by substituting random vector $\mathbf{X}$ on place of numerical vector $\mathbf{x}$.
I am concerned about the fact that random vector $\mathbf{X} = (X_1, \ldots, X_n)$ implicitly depends on $\theta$ because $X_i \sim P_\theta$. This makes it difficult to interpret the maximization process.
Should I treat random variables $(X_1, \ldots, X_n)$ as constants in the maximization process?
If not, what will be the correct interpretation of the above formula?