A textbook defines the generating function f of a random variable X as:

Can anybody please explain that to me?

So far I know:

Generating function of random variable X can also be defined as:

So if we do differentiation:

Taking ,

How is this related to the very first equation?

Any help is much appreciated.