Otitis media is usually caused by a bacterial or viral infection that often arises from another illness, such as a cold or upper respiratory infection. The Eustachian tube, which connects the middle ear to the back of the throat, can become swollen and blocked, leading to fluid build-up and subsequent infection.