Moment generating functions provide an alternative specification for a probability distribution function (pdf), often making it very convenient to calculate expectations, variances, etc. of said pdf.
A moment generating function is defined as:
$M_X(t) = \mathbb{E}(e^{tX}), t\in\mathbb{R}$
A caveat to moment generating functions is that their integrals might not always exist. The more general characteristic function gets around this, and they are defined as:
$C_X(t) = \mathbb{E}(e^{itX}), t\in\mathbb{R}$
Given their tremendous capacity for simplifying the calculation of the moments of a probability distrubtion, moment-generating and characteristic functions seem almost magical -- a wonderful rabbit pulled, from thin air, out of a magician's hat.
Few things are truly that way in the history of mathematics, so I am curious to know how this particular rabbit was born: how did human beings zero in on them?