The T cell system involves several subpopulations of cells with different functions. Although T cells were only discovered late 1950s-60s they are turning out to be the most important part of our adaptive defense. The immune system does not know which microorganisms it will encounter. It does not try to anticipate the future. So just a few T cells specific for each antigen are produced. Both Tc/s and Th cells are antigen specific. These are called the "virgin lymphocyte pool". There may literally be just 10 or 20 cells able to target a particular antigen on a microorganism, so the first response to activation by antigen presenting cells is to multiply in numbers. For as long as the T cells receive antigenic stimulation they will continue to proliferate. Most of the daughter cells go to attack the pathogen and are called "effector cells" but a few are held back as "memory cells". These memory cells don't get involved in the attack on pathogens rather, they act as the filing system to record that the immune system has encountered this particular antigen. The memory cells will act as the cell pool for future proliferation if even more T cells are required.
T cells are what vaccines ultimately activate and produce. The presentation of vaccine antigens to the immune system via antigen presenting cells induces those Th cells that are specific for the particular vaccine antigens to proliferate. Most of the T lymphocytes will be effector cells which will quickly set to work to remove the vaccine antigens. Some of the cells will be memory cells and they now keep the code for the antigens in the vaccine. The next time the immune system encounters the same antigens (on the microorganism this time) the memory cells think; aha! We have seen this antigen before! It wasn't part of us the first time around so it definitely won't be part of us now!!' The memory cells respond far better to antigenic stimulation than virgin lymphocytes. They proliferate more quickly, produce more daughter cells and are more vehement in their attack on the pathogen. In other words, the immune system has adapted to its environment and learned that it is more likely to encounter certain antigens than others. Based on experience, it keeps a memory of those antigens it knows it will probably encounter again and puts more effort into getting rid of antigens it has seen before.