How does a Class group measure the failure of Unique factorization? I have been stuck with a severe problem from last few days. I have developed some intuition for my-self in understanding the class group, but I lost the track of it in my brain. So I am now facing a hell. 
The Class group is given by $\rm{Cl}(F)=$ {Fractional Ideals of F} / {Principle fractional Ideals of F} ,  ($F$ is a quadratic number field)  so that we are actually removing the Principal fractional ideals there  (that's what I understood by quotient group). But how can that class group measure the failure of Unique Factorization ? 
For example a common example that can be found in any text books is $\mathbb{Z[\sqrt{-5}]}$
in which we can factorize $6=2\cdot3=(1+\sqrt{-5})(1-\sqrt{-5})$. So it fails to have unique factorization. Now can someone kindly clarify these points ? 


*

*How can one construct $\rm{Cl}(\sqrt{-5})$ by using the quotient groups ? 

*What are the elements of $\rm{Cl}(\sqrt{-5})$ ? What do those elements indicate ? ( I think they must some-how indicate the residues that are preventing the $\mathbb{Z[\sqrt{-5}]}$ from having a unique factorization ) 

*What does $h(n)$ indicate ? ( Class number ). When $h(n)=1$ it implies that unique factorization exists . But what does the $1$ in $h(n)=1$ indicate. It means that there is one element in the class group , but doesn't that prevent Unique Factorization ? 
EDIT: 

I am interested in knowing whether are there any polynomial time running algorithms that list out all the numbers that fail to hold the unique factorization with in a number field ?

I am expecting that may be Class group might have something to do with these things. By using the class group of a number field can we extract all such numbers ? For example, if we plug in $\mathbb{Z}[\sqrt{-5}]$ then we need to have $6$ and other numbers that don't admit to a unique factorization. 
Please do answer the above points and save me from confusion . 
Thank you.

h=1 means that the size of the class group is 1. That means that the group is the trivial group with only one element, the identity. The identity element of the class group is the equivalence class of principal ideals. Hence h=1 is equivalent to "all fractional ideals are principal" or equivalently "all ideals are principal".
