For example, there is a Hilbert space H. And {$e_{i}$} is the basis of this space.
We know that every f $\in$ H can be represented by linear combination of {$e_{i}$}.
So why do we use $\overline{span\lbrace e_{1},e_{2},...\rbrace } = H$. Why is the closure necessary?
There are different notions of bases. In particular, there are Hamel bases and Schauder bases.
A Hamel basis $B$ for a vector space $V$ (possibly without a norm, possibly over a field that is not $\mathbb{R}$ or $\mathbb{C}$) is a subset that is linearly independent and spanning. By "linear independent", I mean that, given any $x_1, \ldots, x_n \in B$, then $$a_1 x_1 + \ldots + a_n x_n = 0 \implies a_1 = \ldots = a_n = 0.$$ By "spanning", I mean that every $v \in V$ can be expressed as a linear combination of finitely many vectors from $B$.
As an infinite example, consider the vector space of polynomials over a given field, and let $B$ be the set of monomials. Any finite subset of $B$ is linearly independent in the finite sense, so $B$ is linearly independent. Any polynomial is, by definition, a finite linear combination of monomials, so $B$ spans the space too, making it a Hamel basis.
Schauder bases must be defined on a normed linear space (well, a topological vector would probably suffice too). Basically, the difference is that Schauder bases are defined by infinite series, rather than finite sums. A subset $B$ of $V$ is a Schauder basis if every vector $v \in V$ can be expressed uniquely as a sum of the form $$v = \sum_{n=1}^\infty a_n x_n$$ where $a_n$ are scalars, and $x_n \in B$. They have a stronger linear independence property, $$ \sum_{n=1}^\infty a_n x_n = 0 \implies a_n = 0 \; \forall n,$$ but a weaker spanning property, in that we can only say $\overline{\operatorname{span}} B = V$, rather than $\operatorname{span} B = V$.
A Hamel basis for an infinite-dimensional Banach space (e.g. a Hilbert space) must necessarily be uncountable! Compare that to separable Hilbert spaces, which have countable Schauder bases (in fact, orthonormal Schauder bases).