Being direct summand of free module implies having dual basis.
Not every submodule of a free module is a direct summand! A submodule being a direct summand is equivalent to the natural inclusion map having a retraction. The retraction is key in establishing the dual basis result.
By definition, a submodule $P$ of a module $F$ being a direct summand means that there is also a submodule $Q$ such that every $f\in F$ can be written uniquely as $p+q$ for $p\in P,q\in Q$. In particular, we can define $r\colon F\to P$ by $r(f)=p\in P$ where $p$ is the element such that $f=p+q$. Moreover, uniqueness guarantees this is a linear map, and that if $s\colon P\hookrightarrow F$ is the natural inclusion map, then $r\circ s=\mathrm{id}_P$, i.e. that $r\colon F\to P$ is a retraction of $s\colon P\to F$.
To see that not every submodule of a free module is a direct summand, note that $e=r\circ s\colon P\to P$ is idempotent, i.e. satisfies $e\circ e=(s\circ r)\circ(s\circ r)=s\circ(r\circ s)\circ r=s\circ\mathrm{id}_N\circ r=s\circ r=e$. Moreover, we have that $P$, as a direct summand of $F$, is the image of $e$, which is also given by $\{f\in F:e(f)=f\}$. Thus direct summands determine idempotents on $F$.
Suppose now that $F$ is a free module of rank $1$. Then submodules of $F$ are ideals of the ring $R$, endomorphisms of $F$ simply multiplications by elements of the ring $R$, and the idempotents are those of $R$. Therefore any ideal that is not a principal ideal generated by an idempotent is not a direct summand.
Exercise: show that every map with a retraction determines a direct summand.
Now, to understand the relationship with dual basis, let $FB$ be a free module with basis $B$. Then $P$ being a direct summand implies we have $s\colon P\to FS$ with a retraction $r\colon FI\to P$ such that $r\circ s=\mathrm{id}_P$. In particular, the retraction is surjective, and so $r(I)=\{x_i\}\subseteq P$ is a generating family for $P$ because $I$ is a generating set for $FI$. Moreover, the coordinate functions $f_i\colon FB\to R$ such that $x=(f_i(x))$ then have to satisfy $r(x)=\sum f_i(x)x_i$, and we obtain coordinate function $f_i\circ s\colon P\to R$ such that $p=r\circ s(p)=\sum f_i\circ s(p)x_i$.