Let me work only with groups for the sake of familiarity.
The wreath product is defined using the semidirect product, so the first step is to understand the semidirect product categorically. I claim that the correct way to understand the semidirect product is not categorically but higher-categorically, and also that the correct higher-categorical perspective makes it clear that the semidirect product is not a product. The basic claim is the following:
Let $\varphi : G \to \text{Aut}(H)$ be an action of a group $G$ on a group $H$. Then the semidirect product $H \rtimes G$ is the homotopy quotient of $H$ by the action of $G$.
In other words, the semidirect product is not a limit or a colimit, but a 2-colimit (in fact it's the simplest interesting example I know of a 2-colimit).
What does this mean? More generally, let a group $G$ act by automorphisms on an object $c$ in an arbitrary category $C$. The ordinary quotient of $c$ by $G$ is the colimit of the corresponding diagram $BG \to C$, where $BG$ is the one-object category corresponding to $G$. Explicitly, it is an object $c_G$ such that there are natural bijections
$$\text{Hom}(c_G, d) \cong \text{Hom}(c, d)^G.$$
More explicitly, morphisms $c_G \to d$ are $G$-invariant morphisms $c \to d$, where $G$ acts on $\text{Hom}(c, d)$ by precomposition (this is a right action). Even more explicitly, in a concrete category this means that morphisms $c_G \to d$ are morphisms $c \to d$ which take the same value on $G$-orbits.
In particular, we can let $C = \text{Grp}$ and this gives us a notion of the quotient of a group by the action of a group. However, this construction is poorly behaved: explicitly, if $\varphi : G \to \text{Aut}(H)$ is such a group action, then the quotient is the quotient of $H$ by the relations $\varphi(g) h = h$ for all $g \in G, h \in H$, and this construction will often destroy a lot of information about the group action.
But it is possible to do something less violent. In the world of homotopy theory, a less violent alternative to identifying two points of a space is putting a path in between them, which identifies them up to homotopy; this idea leads to things like the mapping cone. I claim that we can do the same sort of thing with groups, thanks to the following important observation:
Groups naturally form a 2-category, not just a category.
This is because groups $G$ are secretly themselves categories $BG$ with one object. Functors between these categories give group homomorphisms, but we can talk not only about functors but about natural transformations. It is a very good exercise to prove the following.
Claim: Let $\varphi_1, \varphi_2 : G \to H$ be a pair of morphisms between groups. Then a natural transformation $\varphi_1 \to \varphi_2$ is precisely an element $h \in H$ such that $\varphi_2(-) h = h \varphi_1(-)$, or equivalently such that $\varphi_2(-) = h \varphi_1(-) h^{-1}$.
The topological picture here is to think of $G, H$ as fundamental groups of based spaces $X, Y$, so that $\varphi_1, \varphi_2$ are induced by two based maps $f_1, f_2 : X \to Y$, and we want to understand when $\varphi_1, \varphi_2$ are freely homotopic (so a homotopy which ignores the basepoints). What can happen is that in a homotopy from $\varphi_1$ to $\varphi_2$ the basepoint can travel around a nontrivial loop in $Y$, which is precisely the element $h$ above.
The idea now is that instead of forcing two elements $h_1, h_2$ of a group to become equal in a quotient, we can "put a path between them" by adjoining a new element $g$ such that $h_2 g = g h_1$, or equivalently such that $h_2 = g h_1 g^{-1}$. This is essentially what happens in the construction of the semidirect product, one presentation of which is
$$H \rtimes G = \langle G, H | \varphi(g) h = ghg^{-1} \rangle.$$
Here I mean the quotient of the free product of $G$ and $H$ by the specified relations. I can be more formal here but it may not be all that helpful to do so; in particular the resulting notion of homotopy quotient can also be described by a universal property, but now involving a natural equivalence of categories rather than a natural bijection of sets.
Anyway, let me connect all this back up to spaces and also to wreath products to describe a topological example of this homotopy quotient idea at work. Take a path-connected space $X$ and consider the space $X^n$ of $n$-tuples of elements in $X$. The quotient $X^n/S_n$ is the configuration space of $n$ unordered and not necessarily distinct elements of $X$, but quotients of spaces by group actions can often fail to be well-behaved, and in homotopy theory-land we can instead take the homotopy quotient, explicitly described by the Borel construction
$$(X^n \times ES_n)/S_n.$$
This is a kind of "homotopy configuration space." The punchline is now that the fundamental group of this space is the wreath product $\pi_1(X) \wr S_n$. (This isn't just a random example either; these spaces can be used, among other things, to define the Steenrod operations.)