Viral pneumonia is an infection caused by a virus, while bacterial pneumonia is caused by bacteria. They also have different symptoms and require different treatments.