How does ear wax occur?

Earwax is a naturally occurring substance in mammalian ears. It is produced in the ear canal as a natural protection from foreign particles such as dust.