An ear infection occurs when a bacterial or viral infection affects the middle ear â the sections of your ear just behind the eardrum. Ear infections can be painful because of inflammation and fluid build-up in the middle ear. Ear infections can be chronic or acute. Acute ear infections are painful but short in duration. Chronic ear infections either do not clear up, or they recur many times. Chronic ear infections can cause permanent damage to the middle and inner ear.