Earwax is produced in the ear canal by the ceruminous glands. Although scientists are still not entirely sure why we have them, wax traps and prevents dust and other tiny, potentially harmful particles from reaching the eardrum. Eventually, wax dries up and slides along any trapped dust or dirt out of the ear.
Everybody produces earwax, but much like hair color or height, the quantities and form are genetically determined. Smaller or unusually formed ear canals may make it hard for the wax to naturally get out of the ear canal. This may lead to earwax accumulation or buildup.