Fist of all, there's a natural isomorphism
$$\Gamma (X,\mathcal{F}) = \mathcal{F} (X) \cong \operatorname{Hom}_\mathcal{Ab} (\mathbb{Z}, \mathcal{F} (X)).$$
(And that's where $\mathbb{Z}$ comes from: it's the free abelian group generated by one element.)
Now I claim that
$$\operatorname{Hom}_\mathcal{Ab} (\mathbb{Z}, \mathcal{F} (X)) \cong \operatorname{Hom}_{\mathcal{PSh} (X)} (\mathbb{Z}_X, i (\mathcal{F})) \cong \operatorname{Hom}_{\mathcal{Sh} (X)} (\mathbb{Z}_X^\mathbf{a}, \mathcal{F}).$$
Here by $\mathbb{Z}_X$ I denote the constant presheaf on $X$ having $\mathbb{Z}$ as its sections, and by $\mathbb{Z}_X^\mathbf{a}$ its sheafification. The second natural isomorphism is basically the definition of sheafification (as the left adjoint to the inclusion $i\colon \mathcal{Sh} (X) \to \mathcal{PSh} (X)$), and we are interested in the first isomorphism.
We need to check that group homomorphisms $f\colon \mathbb{Z} \to \mathcal{F} (X)$ naturally correspond to presheaf morphisms $\mathbb{Z}_X \to \mathcal{F}$. Such a morphism of presheaves is simply a family of homomorphisms $f_U\colon \mathbb{Z} \to \mathcal{F} (U)$ compatible with the restriction maps for $\mathcal{F}$.
In one direction, having such a family $\{ f_U \}$, we just take the homomorphism $f_X\colon \mathbb{Z} \to \mathcal{F} (X)$.
In the other direction, starting from a group homomorphism $f\colon \mathbb{Z} \to \mathcal{F} (X)$, we may define $\{ f_U\colon \mathbb{Z} \to \mathcal{F} (U) \}$ by taking the compositions of $f$ with the restriction maps $\mathcal{F} (X) \to \mathcal{F} (U)$.
This gives a natural bijection.
Of course, $\mathbb{Z}$ may be replaced with any abelian group: $$\operatorname{Hom}_\mathcal{Ab} (A,\mathcal{F} (X)) \cong \operatorname{Hom}_{\mathcal{PSh} (X)} (A_X, \mathcal{F}) \cong \operatorname{Hom}_{\mathcal{Sh} (X)} (A_X^\mathbf{a}, \mathcal{F}).$$
So we just saw that the global section functor is right adjoint to the constant (pre)sheaf functor.