What Causes Ear Infections | Ear infections can be either bacterial or viral infections. They can occur in your middle ear, the part of your ear just behind your eardrum, as well as the outer and inner ear. They often clear up on their own but can be painful due to inflammation or fluid buildup.