Mechanisms of defect formation