Vaccines provide a previous exposure to the disease. This helps your immune system to be prepared the next time it encounters the disease; it will recognize the disease as the one from the vaccine and be more ready to fight it off. That's why it's important to get your flu shot soon! It will help your immune system fight it off if some of the antigens enter your body.
Hope this helps! :)