An upper swollen eyelid occurs due to an inflammation, an infection, a blocked tear duct or oil gland, or an eye allergy.