When I first learned about the ideal class group, I learned that it measures the failure of unique factorization in a number ring. The main justification for this is that a number ring has unique factorization if and only if it has class number $1$.
This is very unsatisfying though because the exact size of the class group is not used, and neither is the entire group structure of the class group. Furthermore, the dichotomy of "UFD / not UFD", while an important first step, doesn't measure the extent to which unique factorization fails, only if it fails or not. So my questions are:
In what way does the exact size of the class group measure the extent to which a number ring fails to have unique factorization? (Beyond the dichotomy of class number $1$ vs. not $1$.)
In what way does the group structure of the class group measure the extent to which a number ring fails to have unique factorization? This I have basically no feeling for: if the class group is $\mathbb{Z}/2 \times \mathbb{Z}/2$ versus $\mathbb{Z}/4$, is that difference measuring anything related to unique factorization? What is it measuring at all?
This is a question that has been asked on SE a few times before (see here and here) but the answers weren't exactly what I was looking for, so I wanted to ask it again. Thanks for the help!