Let $G$ be a group and $$0\rightarrow K\rightarrow M\rightarrow N\rightarrow 0$$ a short exact sequence of groups. Now these are abelian groups, if I want to show that $\text{Hom}(G,M)\rightarrow \text{Hom}(G,N)$ is surjective, I would show that $\text{Ext}^1(G,K)=0$. However, if I'm studying the same question for nonabelian groups, then I do not have the tool of derived categories at my disposal. Can this be overcome with (nonabelian) cohomology?

$\begingroup$ Yes (in some sense). $\endgroup$– Mikhail BorovoiAug 1 '20 at 19:30

3$\begingroup$ @MikhailBorovoi How? $\endgroup$– curious math guyAug 1 '20 at 19:38

2$\begingroup$ See the reference in my comment to this question. $\endgroup$– Mikhail BorovoiAug 1 '20 at 20:45

$\begingroup$ @MikhailBorovoi, you can link to specific comments, not just questions. I think you mean this comment. $\endgroup$– LSpiceAug 1 '20 at 22:07

1$\begingroup$ I took the liberty to edit the title and to add the tag galoiscohomology. This is relevant to my answer. Roll back if you don't like this. $\endgroup$– Mikhail BorovoiAug 3 '20 at 20:55
EDITED, taking into account the comments of Donu Arapura.
As JLA wrote, a homomorphism $f\colon G\to N$ gives an extension \begin{equation}\label{e:E} 1\to K\to E\to G\to 1.\tag{E} \end{equation} This extension defines a homomorphism $$b\colon G\to \operatorname{Out} K$$ called the band (lien, kernel) of \eqref{e:E}. By definition, $H^2(G,K,b)$ is the set of isomorphism classes of extensions \eqref{e:E} bound by $b$.
A cohomology class $\eta(E)\in H^2(G,K,b)$ is called neutral if the extension \eqref{e:E} splits, that is, there exists a homomorphism $G\to E$ such that the composite homomorphism $G\to E\to G$ is the identity automorphism of $G$. In this case we obtain an action $\varphi$ of $G$ on the normal subgroup $K$ of $E$, and we obtain an isomorphism $E\overset{\sim}{\to}K\rtimes_\varphi G$ with the semidirect product.
There may be more that one neutral class in $H^2(G,K,b)$: they correspond to semidirect products with different actions $\varphi$ of $G$ on $K$. I have read that there may be no neutral elements, but I don't know examples. (In the Galois cohomology setting, for a connected reductive group, by Douai's theorem there always exists a neutral element in nonabelian $H^2$; see [2], Proposition 3.1).
If $K$ is abelian, then $\operatorname{Out} K = \operatorname{Aut} K$, so $b$ is just an action of $G$ on $K$, and $H^2(G,K,b)$ is the usual abelian group cohomology $H^2(G,K)$, where $G$ acts on $K$ via $b$.
The set $H^2(G,K,b)$ can be described in terms of cocycles. See Section 1.14 in Springer [1].
The band $b$ defines an action of $G$ on the center $Z=Z(K)$, and we may consider the usual (abelian) group cohomology $H^2(G,Z)$. From the cocyclic description of $H^2(G,K,b)$ it is clear that $H^2(G,Z)$ naturally acts on $H^2(G,K,b)$.
Moreover, if the set $H^2(G,K,b)$ is nonempty, then $H^2(G,Z)$ acts on it simply transitively; see Mac Lane, Homology, Theorem IV.8.8. The set $H^2(G,K,b)$ is nonempty if and only if a certain obstruction $\operatorname{Obs}(G,K,b)\in H^3(G,Z)$ vanishes; see Mac Lane, Theorem IV.8.7.
Note that we should not think that $H^2(G,K,b)$ "equals" $H^2(G,Z)$. First, $H^2(G,K,b)$ does not have a distinguished unit element. Secondly, $H^2(G,K,b)$ has a distinguished subset $N^2(G,K,b)$ of neutral elements. This is important because in many applications one uses nonabelian $H^2$ in order to determine whether a given extension \eqref{e:E} is split or not.
As far as I know, nonabelian $H^2$ is mostly used in the Galois cohomology setting. Namely, if $k$ is an algebraic closure of a field $k_0$ of characteristic 0, $G=\operatorname{Gal}(k/k_0)$, and $Y$ is a quasiprojective $k$variety with additional structure (say, an algebraic group or a homogeneous space) such that for any $\sigma\in G=\operatorname{Gal}(k/k_0)$ there exists an isomorphism $\alpha\colon\sigma Y\overset{\sim}{\to}Y$, then it defines an extension $$1\to \operatorname{Aut} Y\to E\to G\to 1,$$ where $E$ is the set of such pairs $(\alpha,\sigma)$ with a suitably defined composition law. We obtain the cohomology class $\eta(Y)\in H^2(k_0,\operatorname{Aut} Y,b)$ of this extension for a suitable band $b$. The variety $Y$ (with additional structure) admits a $k_0$model if and only if $\eta(Y)$ is neutral, that is, the extension splits; see this question.
For nonabelian $H^2$ in Galois cohomology see:
[1] T. A. Springer, Nonabelian $H^2$ in Galois cohomology, in: Algebraic Groups and Discontinuous Subgroups, Proc. Sympos. Pure Math. 9, Amer. Math. Soc., Providence, 1966, 164182.
[2] M. Borovoi, Abelianization of the second nonabelian Galois cohomology. Duke Math. J. 72 (1993), 217239.
[3] Flicker, Scheiderer, Sujatha, Grothendieck's theorem on nonabelian $H^2$ and local–global principles. J. Amer. Math. Soc. 11 (1998), no. 3, 731–750.
See also newer papers (they refer to these three), and this preprint.

$\begingroup$ If you are interested in nonabelian $H^2$ in Galois cohomology, please ask a separate question, and I will answer it when I have time $\endgroup$ Aug 3 '20 at 11:11

1$\begingroup$ This is a very nice answer. I do have a couple of questions. (1) When you say $\eta(E)$ is neutral, does that mean there exists a lift of $b$ to $G\to Aut(K)$, such that $E$ is the semi direct product? So then it is clear, there may be more than one, or perhaps none. (2) What is the relationship to the old results of EilenbergMaclane "Cohomology theory in abstract groups. II." Annals (1947)? As I recall, they show that the set of extension classes is either empty (with obstructions in $H^3$) or parameterized by $H^2(G, Z)$, where $Z$ is the centre of $K$. $\endgroup$ Aug 3 '20 at 16:54

$\begingroup$ Let me know if you prefer that I ask these as separate questions, rather than as comments. $\endgroup$ Aug 3 '20 at 16:55

$\begingroup$ Of course it's your right not to name your paper if you don't want, and I apologise for an unwanted edit; but too many old MO comments become less useful when "here"type links fade, so I'll put the name of "this preprint" here if it's all right: Borovoi  Extending the exact sequence of nonabelian $H^1$, using nonabelian $H^2$ with coefficients in crossed modules. $\endgroup$– LSpiceAug 3 '20 at 21:07

1$\begingroup$ Thanks again for the interesting answer. Concerning an example. Let $F$ be a nonabelian free group. Choose a surjection $f:F\to G$, where $G$ is finite and nontrivial. Let $K$ be the kernel. $K$ is again nonabelian and free, so it must have trivial centre. By your answer, the nonabelian $H^2$ consists of a single element. This cannot be neutral, because the sequence can't split, as $F$ is torsion free. $\endgroup$ Aug 4 '20 at 15:11
If you have a morphism $f:G\to N\,,$ then you get a $K$extension of $G$ by pulling back the $K$extension of $N\,.$ The morphism $f$ lifts to a morphism into $M$ if and only if this extension is trivial. So you could show the map you want is surjective by showing that all $K$extensions of $G$ are trivial.
If $K$ is abelian, then isomorphism classes of $K$extensions correspond to classes in (abelian) group cohomology.

3$\begingroup$ I think the general approach is sound, but all you need for the morphism to lift is that the extension is split (which doesn't mean it's trivial, since semidirect products exist), so you'll need done kind of pointed set of "extensions modulo splittings" $\endgroup$ Aug 2 '20 at 18:10