An ulcer is a deeper breach of epithelium compared to an erosion or excoriation, and involves damage to both epithelium and lamina propria.An erosion is a superficial breach of the epithelium, with little damage to the underlying lamina propria. A mucosal erosion is an erosion which specifically occurs on a mucous membrane. Only the superficial epithelial cells of the epidermis or of the mucosa are lost, and the lesion can reach the depth of the basement membrane. Erosions heal without scar formation.Excoriation is a term sometimes used to describe a breach of the epithelium which is deeper than an erosion but shallower than an ulcer. This type of lesion is tangential to the rete pegs and shows punctiform (small pinhead spots) bleeding, caused by exposed capillary loops. Causes
Ulcers and erosions can be the result of a spectrum of conditions including:

Those causing auto-immune epithelial damage, damage because of an immune defect (e.g., HIV, leukemia)
Infections (e.g. herpes viruses)
Nutritional disorders (e.g., vitamin deficiencies). Chemicals such as SLS (a common ingredient in many toothpastes) have been linked to mouth ulcers, and have been recognized by public health agencies such as the NHS as a risk factor. Injuries (e.g. biting of the lip, tongue, and cheek, hard foods can scrape the oral tissues, hot foods can cause burns)
Stress: When the body is stressed, the immune symptom may trigger mouth sores

Pathophysiology
The exact pathogenesis is dependent upon the cause.
Microwave ovens sometimes produce food that is cold externally and very hot internally, and this has led to a rise in the frequency of intra-oral thermal burns. Thermal food burns are usually on the palate or posterior buccal mucosa, and appear as zones of erythema and ulceration with necrotic epithelium peripherally. Electrical burns more commonly affect the oral commissure (corner of the mouth). The lesions are usually initially painless, charred and yellow with little bleeding. Swelling then develops and by the fourth day following the burn the area becomes necrotic and the epithelium sloughs off.Electrical burns in the mouth are usually caused by chewing on live electrical wiring (an act that is relatively common among young children). Saliva acts as a conducting medium and an electrical arc flows between the electrical source and the tissues, causing extreme heat and possible tissue destruction. Chemical injury
Caustic chemicals may cause ulceration of the oral mucosa if they are of strong-enough concentration and in contact for a sufficient length of time. The holding of medication in the mouth instead of swallowing it occurs mostly in children, those under psychiatric care, or simply because of a lack of understanding. Holding an aspirin tablet next to a painful tooth in an attempt to relieve pulpitis (toothache) is common, and leads to epithelial necrosis. Chewable aspirin tablets should be swallowed, with the residue quickly cleared from the mouth.Other caustic medications include eugenol and chlorpromazine. Hydrogen peroxide, used to treat gum disease, is also capable of causing epithelial necrosis at concentrations of 1–3%.