An ear infection usually is caused by bacteria and often begins after a child has a sore throat, cold, or other upper respiratory infection. If the upper respiratory infection is bacterial, these same bacteria may spread to the middle ear; if the upper respiratory infection is caused by a virus, such as a cold, bacteria may be drawn to the microbe-friendly environment and move into the middle ear as a secondary infection. Because of the infection, fluid builds up behind the eardrum.