Think of $BG$ and $BH$ as *topological stacks*, whereby one can calculate a topological groupoid presenting the stack $BG\times_{BH} BG$, namely the following: the object space is the space underlying $H$ and the morphism space is $G\times H \times G$. The source map $s\colon G\times H \times G \to H$ is the projection on the middle factor; the target map $t\colon G\times H \times G \to H$ is $(g_1,h,g_2) \mapsto \theta(g_1)^{-1}h\,\theta(g_2)$. (The reason you can do this is because the Lie groupoids presenting the stacks $BG$ and $BH$ only have a single object, so the situation is rather special. For more general Lie groupoids it is a little more fiddly, but not too different.)

For the stack $BG\times_{BH} BG$ to be equivalent to one of the form $BK$ for some *topological* group $K$, the topological groupoid I just described must be *transitive*: every object should be isomorphic to every other object. That is, for every pair $h_1,h_2\in H$ there should be elements $g_1,g_2\in G$ such that $h_2 = \theta(g_1)^{-1}h_1\theta(g_2)$. If $\theta$ is surjective, then you can take $g_1 = e_G$ and $g_2$ any lift of $h_1^{-1}h_2$, so this is a sufficient condition (in the topological case).

Now if we go back to general $\theta$, but take the special case $h_1 = e_H$, then we require for any $h\in H$ that $h= \theta(g_1^{-1}g_2)$, so in fact $\theta$ surjective is a *necessary* condition. To figure out *which* group $K$ it is such that $BG\times_{BH} BG \simeq BK$—it is a priori well-defined up to isomorphism of topological groups—we need to consider the pairs $g_1,g_2$ such that $h = \theta(g_1)^{-1}h\theta(g_2)$ for some chosen $h\in H$. We might as well take $h=e_H$, so that we want pairs $g_1,g_2 \in G$ such that $e_H = \theta(g_1^{-1}g_2)$, or in other words, such that $\theta(g_1) = \theta(g_2)$. The space of such pairs is just $G\times_H G$, which is a topological subgroup of $G\times G$, and so $K=G\times_H G$.

(In fact $G\times \ker \theta \to G\times_H G$, $(g,k) \mapsto (g,gk)$ is a homeomorphism, but only a topological group isomorphism if $\ker \theta \lt G$ is central subgroup.)

Now if we want to do this in *Lie groups*, then everything works, except that we need $K = G\times_H G$ to be a *sub-Lie-group* of $G\times G$, and this is so if $\theta$ is a submersion. But a surjective map of (finite-dimensional) Lie groups is automatically a submersion. Thus $G\to H$ is a surjective submersion, and hence a locally trivial bundle (this follows from using charts derived from the exponential map and the surjective map of the associated Lie algebras).

If we don't care about $BG\times_{BH} BG \simeq BK$ for some $K$, then $\theta$ being a submersion should be enough to make $G\times H \times G \rightrightarrows H$ a Lie groupoid (the only hard part is to show that $(g_1,h,g_2) \mapsto \theta(g_1)^{-1}h\,\theta(g_2)$ is a submersion).

Even in the special case analysed above, we don't know that $K$ is a central subgroup, or that $G\twoheadrightarrow H$ is a central extension, but that's not necessary for your question. So we find ourselves in the situation Dmitri gave in greater generality: $(G\rightrightarrows \ast) \to (H \rightrightarrows \ast)$ is a submersion on arrows and object components.

**Added** There was a small unimportant lie in what I wrote: it is not sufficient in the topological case for $\theta$ to be just surjective, to have an equivalence of stacks $BG \times_{BH} BG \simeq BK$. Namely, it is not true that the groupoid that I described being transitive is enough. One must have a certain map to have local sections, and this boils down to requiring that $\theta$ have local sections. In the smooth case we ask that this map is a surjective *submersion*, but this follows from $\theta$ just being surjective, as this already implies it is a submersion.