The class number of a number field is a highly subtle and nontrivial invariant. To illustrate the extent of our ignorance: it is unknown if there are infinitely many number fields of class number $1$. However, a plausible conjecture of Gauss says that even among real quadratic fields, there are already infinitely many of them!
As you know, the size of the class group $\text{Pic}(\mathcal O_K)$ is related to special values of $\zeta_K(s)$, by the class number formula. The class number formula is most elegantly expressed by saying that $\zeta_K(s)$ has a zero of rank $r_1+r_2-1 = \text{rank}_\mathbf{Z}\: \mathcal O_K^\times$ at $s=0$, and that its leading coefficient $\zeta_K^{(r_1+r_2-1)}(s)/(r_1+r_2-1)!$ equals $hR/\omega$, where $h = |\text{Pic}(\mathcal O_K)|$, $R$ is the regulator of $K$ and $\omega = |(\mathcal O_K^{\times})_{\text{tors}}|$. In practice, however, one cannot hope to rely on the class number formula, say, to bound the class number in a family of number fields. As the case of real quadratic fields shows, the behavior in families is highly irregular.
Choose an embedding of $K$ into $\mathbf C$. Let us write $G$ for the absolute Galois group $\text{Gal}(\overline{K}/K)$, where $\overline{K}$ is the algebraic closure of $K$ in $\mathbf C$.
I will try to show how the problem of bounding the class group is a problem in Galois cohomology.
A word of warning: In what follows, we need to ensure that the Kummer sequence
$$1 \to \mu_n \to \mathbf G_m \xrightarrow{\cdot^n} \mathbf G_m \to 1$$
of étale sheaves on $X=\text{Spec }\mathcal O_K$ is exact, and this is true if and only if $n$ is a unit in $\mathcal O_K$. Therefore, everything that follows is only true for $n=1$, where it is vacuous. This is not a problem we have with curves; thanks to the existence of a base field, we have a large supply of $n$'s which are units. In order to apply this method to a number ring, we should invert a finite set of primes in $\mathcal O_K$ to make some room for ramification. Take what follows as wishful thinking of the fruitful kind.
One deduces from the Kummer sequence (with $n=1$!) the "Kummer-Mordell-Weil" exact sequence
$$1 \to \mathcal{O}_K^\times/(\mathcal{O}_K^\times)^n \to H^1_{ét}(\text{Spec }\mathcal O_K, \mu_n) \to \text{Pic}(\mathcal O_K)[n] \to 1,$$
where $\text{Pic}(\mathcal O_K)[n]$ is the $n$-torsion of the class group.
Base-change to $K$ determines a map $H^1_{ét}(\text{Spec }\mathcal O_K, \mu_n) \to H^1_{ét}(K, \mu_n) = H^1(G, \mu_n)$. According to Kummer theory, $H^1(G, \mu_n) \simeq K^\times/(K^\times)^n$, and in this, $H^1_{ét}(\text{Spec }\mathcal O_K, \mu_n)$ becomes identified with $$(K^\times/(K^\times)^n)(n) = \{ x \in K^\times/(K^\times)^n : \nu(x) \equiv 0 \mod n \quad \forall \nu\},$$ a finite group. The sequence becomes
$$1 \to \mathcal{O}_K^\times/(\mathcal{O}_K^\times)^n \to (K^\times/(K^\times)^n)(n) \to \text{Pic}(\mathcal O_K)[n] \to 1.$$
(If we identify $\text{Pic}(\mathcal O_K)[n]$ via global class field theory with the $n$-torsion of the Galois group of the Hilbert class field of $K$, then the map $(K^\times/(K^\times)^n)(n) \to \text{Pic}(\mathcal O_K)[n]$ identifies with the reciprocity map of global class field theory. The group $(K^\times/(K^\times)^n)(n)$ is the analogue of the $n$-Selmer group of an elliptic curve.)
Thus, the size of $\text{Pic}(\mathcal O_K)[n]$ is controlled by the cokernel of the map $\mathcal{O}_K^\times/(\mathcal{O}_K^\times)^n \to (K^\times/(K^\times)^n)(n)$. This resembles very much the construction of the regulator. In a way, $|\text{Pic}(\mathcal O_K)[n]|$ contributes to the "finite part" of the regulator ("finite part" in the sense that $\widehat{\mathbf Z} \otimes \mathbf Q$ is the finite part of $\mathbf A_\mathbf{Q}$). This suggests that the quantity $hR$ (= class number times regulator) is a more natural invariant of the field $K$, and suggests why it is so difficult to isolate the two factors.
The group $\mathcal{O}_K^\times/(\mathcal{O}_K^\times)^n$ is easy to write down explicitly using Dirichlet's unit theorem. The real difficulty lies in controlling the size of $(K^\times/(K^\times)^n)(n)$. For instance, in order to bound $\text{Pic}(\mathcal O_K)[n]$ below, one would need to construct a sufficiently large collection of nontrivial elements of $(K^\times/(K^\times)^n)(n)$. This is a particular case of "the art of constructing cohomology classes", which is an active area of research.
A general principle says that cohomology classes on an object $X$ can be constructed from objects "lying over $X$" (think of sheaf cohomology). In this context, this point of view is the object of Iwasawa theory and the theory of Euler systems. The construction of cohomology classes is usually an "artisanal" thing. One has to make use of whatever special properties the object considered may have. For instance, the "Euler system of cyclotomic units" allows us to bound the size of class groups of cyclotomic fields. The construction of this Euler system depends crucially on the special arithmetic properties of the tower of cyclotomic fields. For the analogous questions for an elliptic curve over $\mathbf Q$, namely the question of bounding the Selmer group or the Tate-Shafarevich group, one has the theory of homogeneous spaces, Kolyvagin's Euler system...
Finally, one can relate this point of view with the theory of $L$-values via $p$-adic $L$-functions, but that is a whole other story.