Consider two groups, $G$ and $H$, with generating sets $S$ and $T$, respectively. (That is, $G=\langle S \rangle$ and $H=\langle T \rangle$.) Let us say that we can represent elements of both $G$ and $H$ as $n\times n$ matrices. I now want to combine $G$ and $H$ into a new group, denoted $J$. The way I combine the groups is just by multiplication, i.e. every element of $J$ can be written as a product of a finite number of elements of $G$ and $H$.
My question is, what is the set of generators of $J$? Is it just $S\cup T$? Do I need to consider products of elements of from $S$ and $T$? Does the answer depend upon the internal structure of $G$ and $H$?
Now, suppose I further stipulate that $G$ is a Lie group, so $S$ is a finite set of infinitesimal generators (but $H$ is still a finite group). How then could I deduce the generators of this new group $J$?
Apologies if this is question is either elementary or poorly posed. I am not a mathematician by training, but am trying to learn what I can! Thanks in advance for the help!