Theorem. Let $G$ be a nilpotent group. If $X\subseteq G$, then $\langle X\rangle = G$ if and only if $\langle x[G,G]\mid x\in X\rangle = G/[G,G]$.
Proof.. The "only if" clause is easy. We proceed by induction on the nilpotency class of $G$ to prove the "if" clause.
If $G$ is of nilpotency class $1$, then $G$ is abelian, and there is nothing to prove.
Assume the result holds for groups of nilpotency class $c$, and that $G$ has nilpotency class $c+1$. Let $\mathfrak{G}=G/G_{c+1}$ (where $G_k$ is the $k$th term of the lower central series of $G$) Note that $G^{\rm ab}=\mathfrak{G}^{\rm ab}$. Thus, the image of $X$ in $\mathfrak{G}$ generates $\mathfrak{G}$. Thus, $\langle X\rangle G_{c+1} = G$.
We show that $G_{c+1}\subseteq \langle X\rangle$. Indeed, $G_{c+1}$ is generated by elements of the form $[r,g]$, with $r\in G_c$ and $g\in G$. We can write $r = x_1g_1$, with $x_1\in\langle X\rangle\cap G_{c}$ and $g_1\in G_{c+1}$, and $g=x_2g_2$, with $x_2\in \langle X\rangle$ and $g_2\in G_{c+1}$, because $\mathfrak{G}$ is generated by the image of $X$. But since $G_{c+1}$ is central in $G$, we have
$$[r,g] =[x_1g_1,x_2g_2] = [x_1,x_2]\in \langle X\rangle.$$
Thus, $G_{c+1}$ is generated by elements that all lie in $\langle X\rangle$, hence $G_{c+1}\subseteq \langle X\rangle$.
Since we already knew that $\langle X\rangle G_{c+1}=G$, we conclude that $\langle X\rangle = G$, as desired. This completes the induction. $\Box$
Now, apply the theorem with $X=H$.
(If you're familiar with the Frattini subgroup, this is related to the fact that $\Phi(G) = [G,G] G^p$ for $G$ a $p$-group.)
– Ravi Fernando Aug 17 '21 at 00:09