There are two basic kinds of viruses, those that are made of DNA, the stuff we are made of and RNA viruses. These are viruses that contain a more primitive form of genes.
DNA tends to more stable and reliable from generation to generation. Hepatitis B and Small Pox are examples of DNA viruses.
Influenza on the other hand is an RNA virus and a very unstable RNA virus when compared to other RNA viruses. When it invades a host cell it creates million of copies of itself. In the process it kills the host cell. But because RNA virus have poor error checking due to the lack of a proofreading enzyme called DNA polymerase the copies of itself are very sloppy. Over 80% of these copies are unusable and are not infectious. The remaining ones are infectious to other cells but are still not exact copies of the mother virus. They are therefore “quasi-species” that is; they are very similar but not exact. Over time the virus gradually changes in its genetic makeup.
Our immune system recognizes an invader as alien by its genetics. The specific site on the virus that our antibodies recognize is called the “epitope”. If the genetics of the virus change too much i.e. change the epitope then our immune system takes longer to get into action, sometimes too late. If our immune system has been primed to recognize the viruses epitope from recent experience like a vaccination which is exposing that epitope to our antibody factory. This is akin to getting the floor plans. Then our immune system will shift into high gear much quicker because of the headstart. Hence the need for revaccination every year with a virus that is as close to the current strain as possible.
Plus the antibodies that we do make do not stay around in ample supply forever. In the case on Influenza the antibodies last about 4-5 months. This is also why the sickest people should not get vaccinated too soon before the season. After october 1st is generally a good time to get vaccinated that way we can face the influenza season with the optimal quality and quantity of antibodies.