Canker sores form primarily due to a combination of factors including mouth injuries or irritation (such as accidentally biting the cheek or friction from braces), nutritional deficiencies (like lack of iron, folic acid, or vitamin B-12), stress, hormonal changes, food sensitivities or allergies, and sometimes underlying illnesses. They are not caused by a virus and are not contagious. The underlying mechanism seems to involve an immune system response where white blood cells attack the mucosal cells in the mouth, causing painful ulcers. These sores tend to run in families and are more common in children, adolescents, and women. Specific triggers vary by person but often include minor trauma to the mouth, certain foods, and emotional stress.