Infection or inflammation in the lungs causes pneumonia. The infection can be caused due to bacteria, viruses, and other parasites. Bacterial pneumonia is the most common type of pneumonia. Bacteria Streptococcus pneumoniae, Chlamydia trachomatis, Mycoplasma pneumoniae, Haemophilus influenzae, etc., are the causes of bacterial pneumonia.