The answer of the question depends on what kind of generating function is used to define the sequence $(a_n)$. It is not the same an ordinary generating function than an exponential generating function, by example.
An ordinary generating function have the usual form of a power series, that is
$$\sum_k a_k x^k$$
and a exponential generating function have a specific power series form
$$\sum_k a_n\frac{x^k}{k!}$$
A generating function can be an analytic function[*] such that it series expansion (ordinary or exponential) generates (hence it name) the sequence of coefficients $a_n$.
By example: the exponential generating function of the Bernoulli numbers is defined by
$$\frac{x}{1-e^x}=\sum_{k=0}^\infty B_k \frac{x^k}{k!}$$
where in this case the coefficients $B_k$ are the Bernoulli numbers.
Other example: the ordinary generating function of the Fibonacci numbers is
$$\frac{x}{1-x-x^2}=\sum_{k=0}^\infty F_k x^k,\quad |x|<1$$
where the coefficients $F_k$ are the numbers (the sequence of) Fibonacci.
For what is useful a generating function? By example: some generating functions can be used to define a recursion for it coefficients $a_n$, you can see it in the free book generatingfunctionology of Wilf in page 22 where it is introduced the procedure "$x D \log$" to define these recursions.
[*]: I dont knew, just Im seeing now in the wikipedia article about generating functions that a generating function can be just formal, so it doesnt necessarily need to be convergent. In this case if the series diverges it (obviously) doesnt represent an analytical function.