is an infection of the lung tissue. This is unfortunately a very common occurrence, especially in older adults. While not failsafe, there are some ways to prevent this. I would recommend that you have your grandmother see her doctor
to discuss this.
A pneumonia occurs when a bacteria, virus, parasite or fungus enters the lungs. As you suggest, this occurs when the infecting agents goes through the air and enters the lung.
There are a few ways to prevent a pneumonia. Firstly, avoiding people with known pneumonia or who are sick is important. Second, there are some vaccinations that can be used to prevent pneumonia. There is a great vaccination for strep pneumonia (the most common bacteria to cause pneumonia). This needs to be done. You should also have her get the yearly flu vaccine (for a virus).
Another type of pneumonia is aspiration pneumonia. This occurs when bacteria from the mouth goes down "the wrong pipe" an enters the lungs instead of the stomach. Having your grandmother evaluated for appropriate swallowing reflexes is an important way to prevent this type of aspiration.
Beyond the above, good hand hygiene and common sense (avoiding dust, etc.) are important as well. Have your grandmother see her doctor for more information.