The moment generating function $M_X(\theta) = \mathbb{E}[e^{\theta X}]$ captures all the moments of $X$ (via [Moments from the MGF](/theorems/1143)), but this theorem makes the much stronger claim that the MGF determines the entire distribution, not just its moments. Any two random variables with the same MGF in a neighbourhood of the origin must have the same distribution.
This uniqueness is not automatic — it is possible for two different distributions to share all moments (the lognormal provides a classical example). What makes the MGF special is the exponential weighting $e^{\theta x}$, which grows fast enough to "distinguish" between distributions that moments alone cannot separate. The technical requirement is that $M_X(\theta) < \infty$ for all $\theta$ in an open interval around $0$, not just at $\theta = 0$; distributions with tails heavier than exponential (such as the Cauchy or lognormal) fail this condition, and for them the MGF approach is unavailable.
This uniqueness result is what makes the MGF a tool for identifying distributions: to show that a sum of independent normals is normal, one computes the MGF of the sum via [MGF of a Sum](/theorems/1144), recognises the result as a normal MGF, and invokes uniqueness. It is also the foundation of the [Continuity Theorem](/theorems/1145), which extends uniqueness to limits of MGFs.