From the name itself, these cells remember the virus or bacteria they just fought. These cells live in the body for a long time, even after all the viruses from the first infection have been destroyed. So next time the pathogen attacks, it immediately recognises it and fights back.