it doesn't actually, or at least it's not as simple as that. with the Covid vaccine there is no virus being injected at all. it injects a copy of instructions of how the virus is made, not the virus itself, your body then replicates that and creates antibodies to fight it. At no point is anyone ever injected with COVID. And even with live viruses, the virus has been genetically modified to not actually make you fully sick, just allow your body to make antibodies to fight it off if you do get infected.
That is true for the Moderna and Pfizer shot, but the J&J shot is actually considered a "true" vaccine, in that it does inject a modified virus.
"The COVID-19 vaccine from Johnson & Johnson uses existing technology that involves a virus called
adenovirus, a common cause of respiratory infections. The DNA in the adenovirus is modified so that it produces a key part of the SARS-CoV-2 virus particle to which the body then develops an immune response. The adenovirus that delivers the SARS-CoV-2 DNA particle cannot multiply, so it does not cause infection. Because this system is based on stable DNA molecules, it does not require ultracold storage, making it easier to distribute."
"How Does the Johnson & Johnson Vaccine Differ From Other Available COVID-19 Vaccines?"
"The Pfizer and Moderna COVID-19 vaccine technology uses genetic material (mRNA) that code for parts of the SARS-CoV-2 virus protein. This mRNA is protected by lipid nanoparticles (fat bubbles) that, when injected, cause a person's own cells to make pieces of viral particles to which the body develops immunity. Because the genetic material is broken down quickly, it stays in a person's cells for only a short period of time. For this reason, these vaccines must be kept in very cold environments until they are ready to be given."
This JAMA Patient Page explains how the Johnson & Johnson COVID-19 vaccine, likely to be the third SARS-CoV-2 vaccine approved for widespread use, uses an adenovirus 26 vector to deliver coronavirus DNA to host cells to produce spike proteins and safely and effectively induce immunity.
jamanetwork.com