system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do we get earwax???
gpt
earwax, or cerumen, is produced in the inner portion of the ear canal. It migrates out of the ear canal, and falls out. It does this to clean the ear canal of any small debri and bacteria and to an extent keeps water from pooling inside the ear canal.  Cerumen has antibacterial properties that can kill bacteria trying to crawl in the ear, and flushes it out as it works its way out of the ear. Also because it is open to the external environment, it lubricates the ear canal. It keeps it from drying out. So it does three main things: keeps the ear moist, but not waterlogged, kills bacteria, and cleans the ear canal. All of which to protect the tympanic membrane(eardrum).