When a germ such as a virus or bacteria enters your body, your immune system goes into battle. It makes antibodies that locate the germ and launches an attack to fight it off.
After the antibodies have attacked they stick around in the body to protect you if the same germ enters your body again.
Often the antibodies can stop an infection by the remembered germ should it enter your body again. The infection is stopped before you even show signs of being sick!