When you're infected with a new pathogen it can take your white blood cells a while to produce the antibodies to deal with it. In that time you can get very ill, or maybe even die. To help avoid this you can be vaccinated (immunised) against some diseases, e.g. polio or measles.
Some of these white blood cells will remain in the blood as memory cells, so if live pathogens of the same type ever appear, the antibodies that help destroy them will be produced immediately.