I've been taking a course on Category Theory recently and really enjoying it. The lecturer today was discussing the notion of equivalence in more detail and showed that every connected groupoid $\mathcal{Gr}$ (i.e. a groupoid where every two objects are isomorphic) is equivalent to the category $B(\text{Aut}_\mathcal{Gr}(c))$ for any specified object $c \in \text{ob}\,\mathcal{Gr}$. The lecturer then pointed out that you might be tempted to then guess that $$B:\text{Grp}\to \text{ConnGrpd} $$ (where $\text{ConnGrpd}$ is my name for the category of connected groupoids with morphisms being functors) is an equivalence of categories but it is not!
The reason is that this functor, while being fully faithful, fails to be essentially surjective - isomorphisms in $\text{Cat}$ are, well, isomorphisms of categories and not equivalences of categories and so many-object connected groupoids are simply not isomorphic to one-object groupoids. However, this just doesn't feel like a satisfactory answer!
Surely the map $B$ gives some kind of equivalence. When probing my lecturer afterwards he admitted that you could say something about $B$ if you viewed $\text{Cat}$ as a 2-category but that we wouldn't discuss this in our course.
Being impatient, I wondered if the folks on MSE could say anything useful. In particular:
What (2-)categorical notion of "equivalence" does $$B:\text{Grp}\to \text{ConnGrpd}$$ give?
To be clear, I am familiar with the definition of a strict 2-category and the idea of exchange law in $\text{Cat}$ as this is discussed briefly in Chapter 1 of Riehl's Category Theory in Context. An ideal answer will attempt to explain the notion of map that $B$ gives and a little context for the meaning/significance of this weaker notion of equivalence.
If you want $\text{ConnGpd}$ to be capable of capturing the fact that one-object groupoids can be equivalent to many-object groupoids then you need to regard it not as a $1$-category but as a $2$-category, with nontrivial $2$-morphisms given by natural transformations. In that case it's still not true that $B$ is an equivalence, because $\text{Grp}$ is only an ordinary $1$-category while $\text{ConnGpd}$ has nontrivial $2$-morphisms.
Explicitly, you can check as an exercise that if $f_1, f_2 : BG \to BH$ are two functors (that is, group homomorphisms from $G$ to $H$) then a natural transformation from $f_1$ to $f_2$ is exactly an element $h \in H$ satisfying $hf_1(g) h^{-1} = f_2(g)$; in other words, an element of $H$ that conjugates $f_1$ to $f_2$. From here it follows that, for example, the group of automorphisms of the identity functor $BG \to BG$ is the center $Z(G)$.
To turn $B$ into an equivalence you need to modify the target to be the $2$-category of pointed connected groupoids. These are connected groupoids together with the additional data of a distinguished object. We also need to require that functors preserve these objects in a suitable sense. This distinguished object may not seem like it's doing anything but it removes the nontrivial $2$-morphisms and supplies an actual candidate for the inverse of $B$: namely, taking the automorphism group of the distinguished object. This is closely related to the fact that in algebraic topology you need spaces to have a basepoint to define the fundamental group as a functor.
This distinction between connected groupoids and pointed connected groupoids may seem pedantic but it matters a great deal. For example, it affects which group actions exist: a connected groupoid $X$ can be acted on by a group $G$ in a way which fixes no objects of $X$, even up to isomorphism in a suitable sense, and hence which cannot come from an action of $G$ on any pointed version of $X$. A nice example here is the action of the symmetric group $S_n$ on the ordered configuration space $\text{Conf}_n(\mathbb{R}^2)$ of $n$ distinct points in the plane, whose fundamental groupoid is equivalent to $BP_n$ where $P_n$ is the pure braid group. This action does not arise from any action of $S_n$ on the pure braid group $P_n$ itself, or equivalently it does not have any homotopy fixed points; this is in turn equivalent to the fact that quotienting by $S_n$ produces the unordered configuration space, which is equivalent to $BB_n$ where $B_n$ is the braid group, and the corresponding group extension
$$1 \to P_n \to B_n \to S_n \to 1$$
does not split, meaning $B_n$ is not a semidirect product. There is a lot more to say here about the homotopy hypothesis, looping and delooping, and using groupoids to classify group extensions, but this answer is getting too long already...