If you breathe in air that has germs in it, your immune system protects your lungs from getting infected. In fact, the germs that cause pneumonia are usually in the air you breathe, but your body keeps them from going into your lungs and causing a problem.