The automorphism group Aut(X)$\operatorname{Aut}(X)$ of an affine variety X$X$ is an ind-group. Its Lie algebra is canonically embedded into the Lie algebra Vec(X)$\operatorname{Vec}(X)$ of vector fields on X$X$. We study the relations between subgroups of Aut(X)$\operatorname{Aut}(X)$ and Lie subalgebras of Vec(X)$\operatorname{Vec}(X)$. We show that a subgroup G subset of Aut(X)$G\subseteq \operatorname{Aut}(X)$ generated by a family of connected algebraic subgroups Gi$G_i$ of Aut(X)$\operatorname{Aut}(X)$ is algebraic if and only if the Lie algebras LieGi subset of Vec(X)$\operatorname{Lie}G_i \subseteq \operatorname{Vec}(X)$ generate a finite-dimensional Lie subalgebra of Vec(X)$\operatorname{Vec}(X)$. Extending a result by Cohen-Draisma (Transform. Groups 8 (2003), no. 1, 51-68), we prove that a locally finite Lie algebra L subset of Vec(X)$L \subseteq \operatorname{Vec}(X)$ generated by locally nilpotent vector fields is algebraic, that is, L=LieG$L = \operatorname{Lie}G$ for an algebraic subgroup G subset of Aut(X)$G \subseteq \operatorname{Aut}(X)$. Along the same lines, we prove that if a subgroup G subset of Aut(X)$G \subseteq \operatorname{Aut}(X)$ generated by finitely many connected algebraic groups is solvable, then it is an algebraic group. We also show that a unipotent algebraic subgroup U subset of Aut(X)$U \subseteq \operatorname{Aut}(X)$ has derived length <= dimX$\leqslant \dim X$. This result is based on the following triangulation theorem: Every unipotent algebraic subgroup of Aut(An)$\operatorname{Aut}({\mathbb {A}}<^>{n})$ with a dense orbit in An${\mathbb {A}}<^>{n}$ is conjugate to a subgroup of the de Jonquieres subgroup. Furthermore, we give an example of a free subgroup F subset of Aut(A2)$F\subseteq \operatorname{Aut}({\mathbb {A}}<^>{2})$ generated by two algebraic elements such that the Zariski closure F over bar $\overline{F}$ is a free product of two nested commutative closed unipotent ind-subgroups. To any affine ind-group G$\mathfrak {G}$, one can associate a canonical ideal LG subset of LieG$L_\mathfrak {G}\subseteq \operatorname{Lie}\mathfrak {G}$. It is linearly generated by the tangent spaces TeX$T_e X$ for all algebraic subsets X subset of G$X \subseteq \mathfrak {G}$ that are smooth in e$e$. It has the important property that for a surjective homomorphism phi:G -> H$\varphi \colon \mathfrak {G}\rightarrow \mathfrak {H}$, the induced homomorphism d phi e:LG -> LH$d\varphi _e\colon L_\mathfrak {G}\rightarrow L_\mathfrak {H}$ is surjective as well. Moreover, if H subset of G$\mathfrak {H}\subseteq \mathfrak {G}$ is a subnormal closed ind-subgroup of finite codimension, then LH$L_\mathfrak {H}$ has finite codimension in LG$L_\mathfrak {G}$.