Suppose $1\to K \stackrel{m}{\rightarrow} G \stackrel{f}{\rightarrow} H \to 1$ is short exact sequence of groups.
The followings are equivalent:
$(1)\ G\cong K \times H;$
$(2)$ The sequence right splits (i.e. $\exists$ homomorphism $g:H \to G$ s.t. $f\circ g =$ Id$_H$) and $H\cong N \triangleleft G;$
$(3)\ G$ is semidirect product of $K$ and $H$, and $H$ acts on $K$ trivially.
$(4)$ The sequence left splits (i.e. $\exists$ homomorphism $h:G \to K$ s.t. $h\circ m =$ Id$_K$).
However, if $H$ acts on $K$ nontrivially, $G$ may also be direct product.
e.g. let $G$ be a nonabelian group with $h \in G\backslash Z(G)$.
for $1\to G \to G\times \Bbb Z \to \Bbb Z \to 1$, splitting map $g: \Bbb Z \to G \times \Bbb Z, 1 \mapsto (h,1).$
$ \phi: \Bbb Z \to \text{Aut} G,\ \phi(1)(g,1)=(h,1)(g,1)(h,1)^{-1}=(hgh^{-1},1).$
Since $h \not \in Z(G)$, this action is nontrivial.
So under what condition, semidirect product of groups is isomorphic to their direct products?
And more generally, when is $A\rtimes_{\phi_1} B \cong A\rtimes_{\phi_2} B$?