Since multiplication of ideals is associative, the ideals of R form a monoid under multiplication. Bring in the fractional ideals to round out the group. since multiplication in R is commutative, the group is abelian.
The group is free, with maximal ideals acting as generators. In fact it is isomorphic to Zn, where n is the number of maximal ideals. If n is an infinite cardinal, we're talking about the direct sum, not the direct product. That's because each ideal is a finite product of prime ideals.
The product of principal fractional ideals is principal, and the inverse of a principal fractional ideal is principal. Therefore the principal fractional ideals form a subgroup inside the group of fractional ideals. The subgroup of a free group is free, so this principal subgroup also looks like parallel copies of Z, though these generators need not correspond with the generators of the larger group.
The quotient, ideals mod the principal ideals, gives the class group. The class number is the size of the class group. As mentioned earlier, a pid has a trivial class group, with class number equal to 1. On the other hand, an ideal that is not principal becomes a nontrivial element in the class group.
Two ideals, or fractional ideals, represent the same element in the class group if their quotient is principal. If H and J are ideals in R, and u and v are elements of R, write H/J = {v/u}, or {u}H = {v}J.
Every coset in the class group is represented by some fractional ideal, so multiply through by the common denominator, and find another cosrep that is an ideal in R. The ideals represent the entire class group. If H is not principal, there is some other ideal J such that HJ is principal.