Line bundles on a scheme $X$ live in $H^1(X,O_X^*)$, where $O_{X}^{*}$ is the sheaf of invertible functions. If $X$ is noetherian separated, then we can think of this $H^1$ to be Čech cohmology w.r.t. an open affine cover of $X$. We can think of a line bundle as a principal $\mathbb{G}_{m}$ -bundle, where $\mathbb{G}_{m}$ is the multiplicative group scheme, i.e. the result of patching together, via $\mathbb{G}_{m}$ -valued transition functions, local pieces that look like $ U \times \mathbb{G}_{m} $ for $U$ open in $X$.
I apologize if the question sounds trivial to people who have a serious knowledge of stack theory.
First of all, let's take the following definition of "gerbe" (can find in Wikipedia): a gerbe on $X$ is a stack $G$ of groupoids over $X$ which is locally non-empty (each point in $X$ has an open neighbourhood $U$ over which the section category $G(U)$ of the gerbe is not empty) and transitive (for any two objects $a$ and $b$ of $G(U)$ for any open set $U$, there is an open set $V$ inside $U$ such that the restrictions of $a$ and $b$ to $V$ are connected by at least one morphism). And in this context, I think we should add that, locally over $X$, $G$ should be isomorphic to $U\times B \mathbb{G}_{m}$ ($B \mathbb{G}_{m}$ is the classifying stack of $\mathbb{G}_{m}$).
I was told that $\mathbb{G}_{m}$ -gerbes over $X$ up to equivalence correspond to cohomology classes in $H^2(X,\mathbb{G} _{m})$. I would like to understand in concrete (Čech) terms why this bijection should take place. In other words: why the process of patching classifying spaces (edit: rather, classifying stacks) of a group involves passing to the second cohomology group?