Injections that prevent illness put a dead or weakened version of the virus they want to prevent into the body. The body then 'remembers' the virus to make future encounters of the virus easier to manage.