The verdict is still out on an exact cause of mouth ulcers but we do know there are contributing factors at work here.
Mouth ulcers form when the soft tissue -- the epithelial tissue -- becomes wounded, exposing the nerve endings that lie below the surface. Sometimes, it's a common injury, such as something as innocuous as biting the inside of your lip (either from habit or by accident), accidentally injuring gum tissue with your toothbrush or having poorly-fitted dental work (loose dentures or a rough spot on a crown that rubs against the inside of your mouth).
Sometimes it's not due to an injury, though. Aphthous ulcers are associated with emotional stress, deficiencies in B vitamins, folate, iron and zinc, and, sometimes, certain drugs such as non-steroidal anti-inflammatory medicines, drugs to treat osteoporosis (bisphosphonates) and some cancer treatments. They also are prevalent in people with compromised immune systems such as from HIV or other systemic viral infections, skin conditions such as lichen planus or those who have autoimmune disorders such as celiac disease, Crohn's disease and Behçet's syndrome. Food allergies may play a role for some people.
Women are also more likely to have mouth ulcers, especially during pregnancy and just before menstruation, so hormones also play a causal role.
Recurrent mouth ulcers also seem to be in some people's genes -- about one-third of people who have RAUs report it runs in the family [source: Scully]. Although researchers aren't yet sure why this is, a study published in the British Dental Journal found that it might be linked to a problem with the way the immune system behaves, mistaking the body's own healthy cells as foreign.
Because there is no clear cause for mouth ulcers, there is no definitive treatment. There are ways to reduce the symptoms and perhaps reduce the frequency of ulcers, though, while they heal.