A vaccine is a way to protect animals against certain diseases. They work by stimulating the production of immune substances called "antibodies" which will prepare the body to fight against future disease- and illness-causing infections, bacteria, and viruses (some of them deadly). By vaccinating your pet, you are preventing (almost completely!) them from getting sick if it ever comes in contact with the agents against which it's been vaccinated.
There are a variety of pet vaccinations for both cats and dogs. Some are required by law (such as rabies vaccinations), others are required by certain establishments (such as apartment complexes or boarding and grooming facilities) whereas others are simply strongly recommended, depending on your pet's lifestyle.
The main illnesses or diseases that pet vaccinations protect against include:
For dogs: rabies, distemper, parvo virus, hepatitis, and kennel cough (bordetella)
For cats: rabies, feline herpes virus type 1, panleukopenia, and leukemia
It's important to realize that by vaccinating your animal, you're protecting your pet, your family, and your community. Many illnesses can be spread from animal to animal (including wildlife to domesticated animals) and even animal to human. So do your part and get your pets vaccinated!