What is the purpose of ear wax?

Protection. Ear wax is important in providing protection to the ear and can trap dust and other material that may enter the ear canal.