Is the class number of $K$ the number of factorizations an element of $\mathcal{O}_K$ can have? Consider the number field $K = \mathbf{Q}(\sqrt{-5})$, which has ring of integers $\mathcal{O}_K = \mathbf{Z}[\sqrt{-5}]$. It is known that the class number of $K$ is $2$. It is also true that you can write the element $6$ as a product of irreducible elements in two different ways:
$$ 6 = (1+\sqrt{-5})(1-\sqrt{-5}) = (2)(3).$$
I am noticing that the class number is $2$ and the number of different ways to factor $6$ is also $2$; is this a coincidence, or is this true in general?
That is, if a number field $K$ has class number equal to $k$, can we always find an element $x \in \mathcal{O}_K$ that can be factored into irreducibles in $k$ different ways? Is the class number of a number field $K$ equal to the maximum number of ways an element in $\mathcal{O}_K$ can be factored into irreducibles?

(Here, I am considering two factorizations to be the same if they are equal up to units; e.g: $6 = 2\cdot 3$ and $6 = (-2)*(-3)$ are the "same" factorization in $\mathbf{Z}$.)
 A: If the class group is not 1 then there are infinitely many non-principal prime ideals, from which we get a sequence of distinct prime ideals $P_j$ all equivalent in the class group. Let $n$ be the order of $P_1$, then for all $m$ and $l\in  n\ldots nm$, $$\underbrace{\prod_{j=1}^{mn} P_j}_{(a_m)} = \underbrace{(P_l \prod_{j=1}^{n-1} P_j)}_{(b_{m,l})}\underbrace{(\prod_{j=n,j\ne l}^{nm} P_j)}_{(c_{m,l})}$$
Then $b_{m,l}$ is irreducible and it doesn't divide any of the $c_{m,i}$, so you get at least $n(m-1)+1$ factorizations of $a_m$.
A: For class number 2 there is an interpretation, found by Carlitz (A characterization of algebraic number fields with class number two, Proc. Amer. Math. Soc. 11 (1960), 391-392) here: a number field $K$ has class number 2 if and only if (i) $\mathcal O_K$ is not a UFD and (ii) all irreducible factorizations of an element have the same number of irreducible factors.  For example, since $\mathbf Q(\sqrt{-5})$ has class number 2, all irreducible factorizations of 6 will involve 2 factors because you found one such factorization with 2 factors (don't confuse the two roles of 2 there, which is what led to your question).
But $\mathbf Q(\sqrt{-14})$ has class number 4, which is bigger than 2, and that means some element will have two irreducible factorizations with different numbers of factors. For instance,
$$
81 = 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3 = (5+2\sqrt{-14})(5-2\sqrt{-14})
$$
show us irreducible factorizations of 81 with 4 and 2 irreducible factors.
A characterization of number fields with a specific ideal class group $G$ was given in 1983 by Rush (An arithmetic characterization of algebraic number fields with a given class group, Math. Proc. Cambr. Phil. Soc. 94 (1983), 23-28). See here.  It is not as simple as the description Carlitz gave for class number 2.
A: A less-elementary, but occasionally useful, characterization of having class group $H$ (for a Dedekind domain), is that if we localize so as to kill off ideals generating the ideal class group, then the resulting ring is (still Dedekind and) has class number one (and is a PID). So the number of generators of the class group is the minimum number of prime ideals that must be localized-away to obtain a PID.
EDIT: for example, for $\mathfrak p$ a non-principal ideal, but with $\mathfrak p^n=\alpha\cdot \mathfrak o$ principal (here the classgroup is finite), localize the integers $\mathfrak o$ just a little by adjoining $1/\alpha$. Then there are $\beta_1,\ldots,\beta_n\in\mathfrak p$ whose product is the unit $\alpha$ in $\mathfrak o[1/\alpha]$. So all $\beta_i's$ are units in that localized ring, so $\mathfrak p\cdot \mathfrak o[1/\alpha]=\mathfrak o[1/\alpha]$ has become principal.
In fact, every ideal in $\mathfrak o$ that was equivalent to $\mathfrak p$ in $\mathfrak o$ becomes principal, as well.
Indeed, this may be similar to the device mentioned by @OscarLanzi.
