I am trying to understand how maximum likelihood (MLE) and generalized method of moments (GMM) are related to each other. In particular, I often see people saying that MLE can be written in terms of the GMM or some minimum-distance estimators. I am not sure how this is true in general.
Suppose my parameter of interest is $\theta \in \Theta \subseteq \mathbb{R}^k$, and my log-likelihood is given by $L(\theta) = \frac{1}{n} \sum^n_{i=1} f(x_i; \theta)$. Then, the first-order conditions for MLE is given by the system of $k$ equations
$$ \nabla_\theta L(\theta) = 0_{k}. $$ Equivalently, this is to solve $$ \frac{\partial L(\theta)}{\partial \theta_i} = 0 \quad \text{ for all $i = 1, \ldots, k$}. $$
From the Wikipedia page, it suggests that MLE can be written as a form of GMM using the moment conditions formed by my first-order conditions. In my notation, the moment condition is
$$ E[g(\theta)] := E[\nabla_\theta F(\theta)] = 0_k. $$
The GMM objective function is given by
$$ \min_{\theta \in \Theta} g(\theta)'W_n g(\theta), $$ for some weighting matrix $W_n$. I think one way to pick $W_n$ here is to set it as the identity matrix.
Then, the first-order condition of the GMM objective is
$$ \nabla_{\theta} g(\theta) W_n g(\theta) = 0_k. $$
Substituting back the definition of $g$ above, we have
$$ \nabla_{\theta\theta} L(\theta) W_n \nabla_{\theta} L(\theta) = 0_k. $$
My question is, how is the GMM estimator related to the MLE estimator? By looking at the first-order conditions of the two estimators, I don't think they are the same unless we impose more conditions. For instance, the second derivative appeared in the GMM first-order condition, whereas only the first derivative appeared in the MLE first-order condition.
Any thoughts are very much appreciated.