Pneumonia is an infection that fills your lungs with fluid or pus, making it hard to breathe and get oxygen into your blood
Pneumonia happens when germs—bacteria, viruses, or fungi—get into your lungs and cause inflammation. Your lungs have tiny air sacs called alveoli. Normally they fill with air. When you have pneumonia, these sacs fill with fluid or pus instead. That means less room for air, so your body struggles to get the oxygen it needs. The infection can start in one part of your lung or spread through both.
You don't catch pneumonia the way you catch a cold from someone sneezing on you, though that can happen. More often, pneumonia develops after another illness weakens your immune system, or when germs you breathe in find their way deep into your lungs instead of staying in your upper airways where your body can clear them out.
Key Takeaways
- Pneumonia occurs when bacteria, viruses, or fungi infect the air sacs in your lungs and cause them to fill with fluid or pus.
- Bacterial pneumonia is the most common type in adults and often develops after a cold or flu has weakened your immune system.
- Viral pneumonia is usually milder than bacterial pneumonia but can sometimes lead to secondary bacterial infection.
- Risk factors include smoking, chronic lung disease, being over 65, having a weakened immune system, and recent hospitalization.
- Pneumonia spreads through respiratory droplets when an infected person coughs or sneezes, but most people who are exposed do not develop it.
How bacterial pneumonia develops
Bacterial pneumonia is the most common type in adults. The bacteria usually enter your lungs when you breathe them in, but they can also travel through your bloodstream from an infection elsewhere in your body. Common bacteria that cause pneumonia include Streptococcus pneumoniae, Haemophilus influenzae, and Legionella.
Bacterial pneumonia often follows a viral illness like the flu or a cold. Here's why: when a virus infects your lungs, it damages the cells that line your airways and produce mucus. That damage makes it easier for bacteria to settle in and multiply. Your immune system is also busy fighting the virus, so it's slower to respond to the bacterial invader. This is why people sometimes get pneumonia a week or two after they seemed to be recovering from the flu.
Bacterial pneumonia can also develop if you inhale bacteria directly—for example, if you aspirate food or liquid into your lungs instead of swallowing it normally. This happens more often in people who have trouble swallowing, are sedated, or have been lying down for a long time.
How viral pneumonia develops
Viral pneumonia is caused by viruses like influenza, respiratory syncytial virus (RSV), or coronavirus. These viruses infect the cells lining your airways and air sacs directly. The infection causes inflammation and swelling, which narrows your airways and makes breathing harder.
Viral pneumonia is usually milder than bacterial pneumonia, and your body often clears it on its own within a few weeks. However, viral pneumonia can weaken your lungs enough that bacteria move in afterward, turning it into a secondary bacterial infection. This combination is often more serious than either infection alone.
Viral pneumonia spreads the same way cold and flu do: through respiratory droplets when someone coughs or sneezes. You can also catch it by touching a contaminated surface and then touching your face.
Fungal pneumonia and other less common causes
Fungal pneumonia is less common than bacterial or viral pneumonia and usually only develops in people with weakened immune systems. People with HIV/AIDS, those taking immunosuppressant medications, or those who have had an organ transplant are at higher risk. Fungal pneumonia can also develop after prolonged antibiotic use, which kills off the bacteria that normally keep fungi in check.
Aspiration pneumonia occurs when you inhale food, liquid, or stomach contents into your lungs instead of swallowing them. This is more likely if you have difficulty swallowing, are unconscious, or have had a stroke. The material itself can irritate your lungs, and bacteria from your mouth or stomach can cause infection.
Chemical pneumonia can develop if you inhale toxic fumes or gases. This is different from infectious pneumonia because it's not caused by germs, but the symptoms and damage to your lungs can be similar.
Who is at higher risk for pneumonia
Your risk of developing pneumonia depends on your age, overall health, and what your immune system is dealing with. Adults over 65 have higher rates of pneumonia, as do infants under 2. People with chronic lung disease like COPD or asthma are more vulnerable because their airways are already inflamed and damaged.
Smoking damages the cells that clear mucus and germs from your lungs, so smokers develop pneumonia more often. People with weakened immune systems—from HIV, chemotherapy, or medications that suppress immunity—cannot fight off infection as well. Recent hospitalization, especially if you were on a ventilator, also raises your risk because you may have been exposed to bacteria that are resistant to common antibiotics.
Other risk factors include heart disease, diabetes, alcohol use disorder, and being bedridden or immobile for long periods. If you have any of these conditions, your doctor may recommend pneumonia vaccines to lower your risk.
How pneumonia spreads from person to person
Pneumonia spreads through respiratory droplets—tiny particles of fluid that come out of your mouth and nose when you cough, sneeze, or even talk. If someone nearby breathes in these droplets, the germs can land in their lungs. You can also catch pneumonia by touching a surface contaminated with respiratory droplets and then touching your face.
However, not everyone exposed to pneumonia-causing germs will develop pneumonia. Your immune system, vaccination status, and overall health determine whether the germs take hold. People with healthy immune systems often fight off the infection before symptoms start, or they may develop only mild symptoms.
Healthcare settings carry higher risk because hospitalized patients often have weakened immune systems and may be exposed to bacteria that resist antibiotics. This is why healthcare workers follow strict infection control procedures.
The difference between pneumonia and bronchitis
Pneumonia and bronchitis are both respiratory infections, but they affect different parts of your lungs. Bronchitis infects the larger airways (bronchi) that carry air to your lungs. Pneumonia infects the tiny air sacs (alveoli) deep in your lungs where oxygen exchange happens.
Because pneumonia affects the air sacs where oxygen enters your blood, it causes more serious symptoms. You're more likely to have a high fever, shortness of breath, and chest pain with pneumonia. Bronchitis usually causes a persistent cough but less severe breathing problems. Bronchitis can turn into pneumonia if the infection spreads deeper into your lungs, especially if your immune system is weak.
Both can be caused by viruses or bacteria, and both spread through respiratory droplets. The main difference is where the infection settles and how much it interferes with oxygen getting into your blood.
Frequently Asked Questions
Can you get pneumonia from being cold or wet?
No. Cold weather and wet conditions don't cause pneumonia directly. However, cold weather can make you more likely to spend time indoors with others, increasing your exposure to respiratory germs. Being cold or wet may also stress your immune system slightly, but the infection itself requires exposure to bacteria, viruses, or fungi.
Is pneumonia contagious?
The germs that cause pneumonia are contagious, but pneumonia itself is not. You can catch the virus or bacteria from someone with pneumonia, but whether you develop pneumonia depends on your immune system and health. Many people exposed to pneumonia-causing germs never develop the disease.
Can pneumonia develop without a cough?
Yes, especially in older adults or people with weakened immune systems. Some people develop pneumonia with only fever, shortness of breath, or confusion as their main symptoms. This is why pneumonia can be missed in elderly patients or those in hospitals, and why a chest X-ray is often needed to confirm the diagnosis.
Does everyone who gets the flu develop pneumonia?
No. Most people recover from the flu without developing pneumonia. However, pneumonia is a common complication of severe flu, especially in older adults, young children, and people with chronic health conditions. This is why flu prevention through vaccination is important for high-risk groups.
Can you get pneumonia more than once?
Yes. Having pneumonia once does not make you immune to future infections. You can catch pneumonia again from different germs, or even from the same type of bacteria or virus if your immune system has weakened. This is why people at high risk may receive pneumonia vaccines.