Well, viruses - like every other living (or pseudo-living, in the case of viruses lol) entity - are subject to evolution. This explains how they are able to change over time, and how we need new flu shots every so often.
Viruses are much simpler "life"-forms (I hesitate to say this, as viruses are not truly 'alive' per se) - often they are simply a strand of DNA or RNA inside a protein case (capsid). Because of their lack of relative complexity, often they are able to mutate quite rapidly by alterations to their genetic code.
This leads to the effect on the cell. Our immune system combats viral infection by stopping the virus from binding to and interfering with our cells (in the case of the influenza virus, read up about neuraminidase and haemagglutinin). If the virus is able to evolve its surface binding proteins by mutations to its genetic coding, it can bypass immune recognition of other, previous forms of that virus. Influenza is exemplary of this great capacity to change - there are many forms of the virus, categorised into the types of haemagglutinin and neuraminidase they possess; e.g. H1N1, H5N2, H7N4 etc.