Alopecia areata develops when immune cells attack hair follicles due to autoimmune dysfunction. Stress, sleep deprivation, and infections are considered major contributing factors.