Pneumonia develops when germs—bacteria, viruses, or fungi—reach your lungs and cause infection and inflammation
Pneumonia is not something you catch like a cold. It is an infection that starts when germs get into your lungs and your body's immune response creates inflammation. The germs can come from the air you breathe, from your own mouth and throat, or from your bloodstream. Not everyone exposed to these germs develops pneumonia—it depends on which germ it is, how many you inhale, and how strong your immune system is at that moment.
The infection causes your lung's air sacs (called alveoli) to fill with fluid or pus. This makes it harder for oxygen to reach your blood, which is why pneumonia causes coughing, fever, and difficulty breathing. Some people develop pneumonia after another illness weakens their defenses. Others get it from a single exposure to a particularly aggressive germ.
Key Takeaways
- Pneumonia happens when bacteria, viruses, or fungi reach your lungs and cause infection, not from a single exposure or behavior.
- You can inhale germs from the air, from droplets when someone coughs or sneezes, or from your own mouth and throat if you aspirate.
- Certain conditions—smoking, chronic lung disease, weakened immunity, recent surgery, or being bedridden—make pneumonia much more likely.
- Pneumonia is not contagious itself, but the germs that cause it spread from person to person, so not everyone exposed will develop the infection.
How germs reach your lungs
Most pneumonia comes from breathing in germs that are already in the air around you or in droplets from someone else's cough or sneeze. These germs travel down your windpipe and into your lungs. Your lungs have natural defenses—mucus, cilia (tiny hairs that sweep debris out), and white blood cells—that usually trap and kill these germs before they cause trouble.
A second route is aspiration, which happens when you inhale something that should go down your food pipe instead. This can be food, saliva, or stomach contents. People who have trouble swallowing, who are sedated, or who are lying flat are at higher risk. The germs in your mouth and throat can then settle in your lungs and cause infection.
A third, less common route is through your bloodstream. If you have an infection elsewhere in your body—a urinary tract infection, an infected wound, or endocarditis (heart valve infection)—germs can travel through your blood and lodge in your lungs.
Why some people develop pneumonia and others don't
Your immune system is your first line of defense. If it is working well, you can breathe in pneumonia-causing germs and never get sick. But if your immune system is weakened or overwhelmed, those same germs can take hold. This is why pneumonia often follows a cold or flu—the virus has already stressed your immune system, and a bacterial infection can move in afterward.
Certain conditions make your lungs more vulnerable. Smoking damages the cilia that sweep germs out, so smokers are at higher risk. Chronic obstructive pulmonary disease (COPD), asthma, and cystic fibrosis all change how your lungs clear mucus and germs. Heart disease, diabetes, and kidney disease weaken your overall immune response. Recent surgery, especially chest or abdominal surgery, increases risk because pain and sedation make you less likely to cough and clear your lungs.
Age matters too. Infants under 2 and adults over 65 have weaker immune responses. Being bedridden or immobile—whether from surgery, injury, or illness—makes it easier for germs to settle in your lungs because you are not moving around to help clear them.
The difference between catching germs and developing pneumonia
The germs that cause pneumonia spread from person to person, but pneumonia itself is not contagious. You can catch the cold or flu virus from someone, but whether you develop pneumonia depends on your own risk factors. Two people can be exposed to the same germ—one develops pneumonia, the other does not.
This is important because it means you cannot simply "catch pneumonia" the way you catch a cold. You have to be exposed to a germ that causes pneumonia, and your lungs and immune system have to be in a state where that germ can take hold and multiply. The exposure is necessary but not sufficient.
Specific germs that cause pneumonia
Bacterial pneumonia is often caused by Streptococcus pneumoniae, Haemophilus influenzae, or Legionella. Streptococcus pneumoniae is common in people recovering from a cold or flu. Legionella grows in warm water systems like air conditioning units and hot tubs, so exposure depends on where you spend time.
Viral pneumonia can be caused by influenza, respiratory syncytial virus (RSV), rhinovirus, or coronavirus. Viral pneumonia is usually milder than bacterial, but it can open the door to a secondary bacterial infection.
Fungal pneumonia is less common and usually only develops in people with severely weakened immune systems—those with HIV/AIDS, on immunosuppressant medications, or recovering from an organ transplant. The fungi are often in soil or bird droppings, so exposure depends on environment and occupation.
Situations that increase your risk
Hospital stays and nursing homes carry higher pneumonia risk because vulnerable people are concentrated in one place, and germs spread more easily. Mechanical ventilation (a breathing tube) significantly increases risk because the tube bypasses your normal defenses and germs can travel directly into your lungs.
Alcohol use disorder weakens your immune system and impairs your cough reflex, making aspiration more likely. Malnutrition has the same effect. Certain medications—corticosteroids, immunosuppressants, and some cancer drugs—deliberately weaken your immune response, which is necessary for their intended purpose but leaves you more vulnerable to infection.
Being unconscious or heavily sedated prevents you from coughing, which is your lungs' main way of clearing germs and mucus. This is why pneumonia is a risk after surgery or in people in a coma.
What happens once pneumonia starts
Once germs establish themselves in your lungs, your immune system responds by sending white blood cells to fight the infection. This causes inflammation—swelling and fluid buildup in the air sacs. Your body also raises your temperature (fever) as a way to slow the germ's growth. You develop a cough as your lungs try to clear the fluid and mucus.
If your immune system wins the fight, the infection clears over days or weeks. If the infection spreads or your immune system cannot control it, pneumonia can become severe. The fluid in your lungs makes it harder to get oxygen into your blood, which is why severe pneumonia causes shortness of breath and can require hospitalization.
Frequently Asked Questions
Can you get pneumonia from being cold or wet?
No. Cold weather and wet clothes do not cause pneumonia. You develop pneumonia only when germs reach your lungs and multiply. Cold or wet conditions might make you more likely to spend time indoors where germs spread more easily, but the cold itself is not the cause.
Is pneumonia contagious?
Pneumonia itself is not contagious, but the germs that cause it are. If someone has bacterial pneumonia caused by Streptococcus pneumoniae, they can spread that bacterium to others through coughs or sneezes. Whether the person who is exposed develops pneumonia depends on their own immune system and risk factors.
Can you develop pneumonia without being sick first?
Yes. You can inhale pneumonia-causing germs and develop the infection without having a cold or flu first. However, pneumonia is more common after a respiratory illness because the virus has already stressed your immune system and damaged your lungs' defenses.
Why do some people get pneumonia every year?
Repeated pneumonia usually means an underlying condition is making your lungs more vulnerable—chronic lung disease, a weakened immune system, or a structural problem in your lungs that makes it hard to clear germs. A doctor can investigate why this is happening and recommend prevention strategies.
Can pneumonia develop from aspirating food?
Yes. If food, saliva, or stomach contents reach your lungs instead of going down your food pipe, germs in that material can cause aspiration pneumonia. This is more common in people with swallowing problems, those who are sedated, or those lying flat for long periods.