Pneumonia is an infection that causes inflammation in the air sacs of the lungs, known as alveoli. This condition can be caused by various pathogens, including bacteria, viruses, fungi, and sometimes by inhaling foreign substances. The inflammation leads to fluid or pus accumulation in the alveoli, which impairs the lungs’ ability to exchange oxygen and carbon dioxide effectively.