A virus is not a cell. It is a piece of genetic material inside a protein coat, and it has no way to make new viruses on its own. To reproduce, it must get inside a living host cell and use that cell's own machinery. A virus that infects bacteria follows one of two pathways.
First the virus attaches to the surface of the host cell and its genetic material enters. In the lytic pathway, the viral genetic material takes over the cell straight away. The cell makes many copies of the viral genetic material and protein coats, these are assembled into new viruses, and the host cell finally bursts open (lysis) to release them. The new viruses can then infect other cells.
In the lysogenic pathway, the viral DNA does not take over at once. Instead it is joined into the host cell's chromosome. The virus is dormant, no new viruses are made, and the host cell seems healthy. Each time the host cell divides, the viral DNA is copied along with the chromosome, so both daughter cells carry it. A trigger such as stress can later switch the virus to the lytic pathway.