Our body has cells that remember the virus which has attacked in the past and the way it was fought, causing recovery of the body. Such cells take a few weeks to get activated in the body because of which arises the possibility of getting infected even after taking the vaccine shot. Though the different types of vaccines work differently, what is common is that they leave some kind of material or protein of the virus that causes COVID-19. This activates the body's immune system to fight against it and also remember it in future.