Let us see what is happening here.
Suppose that $X$ is a non-empty set. A collection $\mathcal{B}$ of subsets of $X$ is called a basis for a topology on $X$ if (i) For each $x\in X$ there exists a $B\in\mathcal{B}$ such that, $x\in B$ and (ii) For every $B_1,B_2\in\mathcal{B}$ for which $B_1\cap B_2\neq\phi$ whenever, $y\in B_1\cap B_2$ there exists a $B_3\in\mathcal{B}$ such that $y\in B_3$ and $B_3\subseteq B_1\cap B_2$.
Note that in this definition a priori there is no topology on $X$. But in fact, there exists a smallest topology on $X$ containing the sets in $\mathcal{B}$. To see this define, $\tau_\mathcal{B}:=\{U\subseteq X\,:\,\forall\,x\in U\, \exists B\in\mathcal{B}\,\text{such that}\,x\in B\,\text{and} \,B\subseteq U\}$. It is easy to check that $\tau_\mathcal{B}$ is the smallest topology on $X$ containing $\mathcal{B}$ as a subset. This is called the topology on $X$ generated by $\mathcal{B}$. Now why this definition is important ? Let us illustrate it with an easy example.
Consider the set $X=C[0,1]$. It is a vector space over $\mathbb{R}$. For each $p\in [0,1]$ define, $ev_p:X\to\mathbb{R}$ by, $ev_p(f)=f(p)$. Then with respect to norm topology on $X$ these maps are continuous. But if anyone asks what's the smallest topology on $X$ for which these maps are continuous ? It's hard to specify all the open sets in a concrete way. But this can be done by using the concept for basis for a topology. Let us see how can we do it ?
We want all the $g_p$ to be continuous. So for any open set $V$ in $\mathbb{R}$ we want $g_p^{-1}(V)$ to be open in $X$. So, for every finite set $F$ of $[0,1]$ we want, $\bigcap_{i€F} g_i^{-1}(V_i)$ to be open in $[0,1]$. So this topology must have these open sets. One can also see that subsets of these form form a basis for a topology on $X$. So the smallest topology containing these subsets is precisely the smallest topology on $X$ wrt which these maps are continuous. Now you ask why are we interested in smallest such topologies. One common intention to reduce the number of open sets so that some non-compact subsets becomes compact in new topology without hampering the continuity of the maps in question. This allows us to use compactness in different important fields of mathematics. You can see Banach-Alaoglu theorem to better understand what I am saying.
Now coming to definition 2. In this case you already have a topology. It is analogous to vector space (in this case topological space) and it's basis (basis for the existing topology). It's easy (?) to study properties of vector spaces in terms of its basic elements. These elements carry all the algebraic information of a vector space ie. they determine your vector space uniquely up to isomorphisms. Same thing happens with basis for a existing topology. Continuity, limits can be defined in terms of basis for the existing topology. Sometimes it is convenient because there are usually concrete definitions of basic open sets but no such concrete descriptions of a general open set. So studying basis for existing topology makes our life easier.
Two definitions has two different use cases. Definition 1 helps us to define complicated topologies using simple starting "open sets" and the definition 2 helps us to manipulate continuity and limits in a very efficient manner.
But these two definitions don't conflict each other. Since, in $\tau_\mathcal{B}$, $\mathcal{B}$ then becomes a basis for the existing topology. Also you can try to show that if $\mathcal{C}$ is already a basis for some existing topology then the topology generated by $\mathcal{C}$ is exactly the pre-existing topology.
I think it will be now clear to you.