As it turns out, that gunk in your ears is actually beneficial to your health! Medically known as cerumen, earwax is produced from the ears's sebaceous glands and aprocrine sweat glands. The bulk of earwax (60 percent) is made up of dead skin cells, followed by lipids (12-20 percent), which give the substance its waxy characteristic.
The role of earwax is not to gross you out, but to protect dirt and pathogens from lodging themselves deep inside your ears. Without it, your ear would be susceptible to foreign invaders, such as bacteria and insects.
One important note to remember is that the ear is self-cleaning. When you talk or chew, the wax buildup is slowly carried outward. That means there's really no need to jam cotton swabs inside your ears to pull out the wax. In fact, cottons swabs could do more harm than good, as they can jam the build-up further into the ear and impede hearing.
So next time you find some earwax falling out, just be thankful for their presence!