There is a close relationship between generating functions and formal power series.
However, they are not the same. Given a sequence, $\,a_0,a_1,a_2,\dots,\,$ define the
formal power series $\,f(x):=a_0+a_1x+a_2x^2+\dots\,$ associated to the sequence.
The sequence and the formal power series are almost exactly the same except
for the $\,x\,$ associated with the power series. Note that the $\,f(x)\,$
and the power series are defined to be exactly the same. The notation $\,f(x)\,$ suggests that it is a function, but with restrictions
since the series may not converge for all $\,x,\,$ hence the reason for the "formal"
in the name. For example, $\,f(rx) = a_0+a_1rx+a_2r^2x^2+\dots\,$ is defined
but $\,f(1+x)\,$ is not defined. So $\,f(y)\,$ is defined for $\,y\,$
being a formal power series with constant term of $\,0.$ It is a function
defined on a subset of formal power series. More precisely, there is an
operation of substitution defined on formal power series, with restrictions,
and if $\,y:=b_1x+b_2x^2+\dots,\,$ then $\,f(y)\,$ denotes the substitution
of $\,y\,$ into $\,f(x).\,$ Thus, $\,f(x)\,$ is an ordinary formal power
series, but the substitution (also known as the evaluation) operation which
maps $\,y\,$ to $\,f(y)\,$ is the "function" associated with $\,f(x).\,$
The idea is that an ordinary algebraic expression, for example,
$\,\frac{1}{1-rx}\,$ may be "expanded" into the power series $\,1+rx+rx^2+\dots\,$
associated with the sequence $\,1,r,r^2,\dots\,$ and hence $\,\frac{1}{1-rx}\,$ is
the generating function of the sequence. The idea is that the generating function
may sometimes be determined algebraically using some recurrence satisfied by the
sequence and that this may help to determine an expression for the sequence itself.
In the example, the recurrence relation $\,a_{n+1}=r\,a_n\,$ with initial value of
$\,a_0=1\,$ is translated into the algebraic equation $\,\frac{f(x)-1}x=r\,f(x)\,$
whose unique solution is $\,f(x)=\frac{1}{1-rx}.\,$
There are variations of generating functions besides the usual, ordinary one. For
example, $\,f(x):= a_0 + a_1\frac{x^1}{1!} + a_2\frac{x^2}{2!}+\dots\,$ is called
the exponential generating function of the sequence. Another example,
$\,f(s):= \frac{a_1}{1^s}+\frac{a_2}{2^s}+\frac{a_3}{3^s}\dots\,$ is called the
Dirichlet generating function of the sequence.