How does mother-of-pearl perfect itself?

As it grows, nacre is anything but regular. But then a process kicks in, in which the defects attract each other and mutually annihilate each other.