How does the flu vaccine work to protect you from illness?

How does the flu vaccine work to protect you from illness?