Pathogens are microorganisms that can cause disease. If they enter the body, they can start an immune response. On their surface, they have antigens, which are substances that start that immune response. Antigens are recognised by antibodies. Antibodies are made by white blood cells as one of the several ways of fighting and destroying the pathogens. Each antibody is unique to the antigen, and once recognised, the WBCs reproduce quickly to make many copies of that specific antibody. The antibodies then can neutralise the pathogen. This is the typical immune response.
Vaccination involves injecting an inactivated form of the pathogen that acts as the antigen, stimulating an immune response. This leads to lots of antibodies being made to fight that particular pathogen. If we were to come across an active form of the pathogen later in our lives, our bodies would be much quicker at recognising it and producing the antibodies to fight it before it causes any serious damage.