Bacteriophages are viral organisms that attack bacteria and use their machinery to replicate.
Bacteriophages attach themselves to the bacterial cell membrane to enter the cell.
They replicate in the bacterial cell and use their machinery to create more copies of themselves.
In the lytic phase the phage makes more copies of itself and bursts out release more bacterial cells killing the bacteria.
In the lysogenic phase, the phage DNA gets integrated inside the host genome and stays dormant for multiple DNA replications, and then enters into the lytic phase later to release the phage cells lysing the bacterial cell.