Ring theory is the art of extracting properties from the integers and working out how they interact with each other. From this point of view, a unique factorisation domain is a ring in which the integers' Fundamental Theorem of Arithmetic holds.
There have been various incorrect "proofs" of Fermat's Last Theorem throughout the ages; it turns out that if we assume the false "fact" that all subrings of are unique factorisation domains, then FLT is not particularly difficult to prove. This is an example of where abstraction really is helpful: having a name for the concept of a UFD, and a few examples, makes it clear that it is not a trivial property and that it does need to be checked whenever we try and use it.
Let be an integral domain. Then is a unique factorisation domain if every nonzero non-unit element of may be expressed as a product of irreducibles, and moreover this expression is unique up to reordering and multiplying by units.
We must set things up so that we don't care about units in the factorisations we discover. Indeed, if is a unit [1], then is always equal to , and this "looks like" a different factorisation into irreducibles. ( is irreducible if is irreducible and is a unit.) The best we could possibly hope for is that the factorisation would be unique if we ignored multiplying by invertible elements, because those we may always forget about.
In , the units are precisely and . We have that or or ; we need these to be "the same" somehow.
The way we make them be "the same" is to insist that the and are "the same" and the and are "the same" (because they only differ by multiplication of the unit ), and to note that is not irreducible (because irreducibles are specifically defined to be non-unit) so is not actually a factorisation into irreducibles.
That way, is not a valid decomposition anyway, and is just the same as because each of the irreducibles is the same up to multiplication by units.
That is, it has a multiplicative inverse .