Bacteria reproduce by making copies of themselves. To do this they need a source of nutrients for energy and they need warm, moist conditions so the chemical reactions inside them can take place.
Unfortunately for us, there are lots of places inside the human body where you find these conditions, e.g. your intestines, so a few bacteria can quickly become a large colony inside the body.
Viruses need other cells to reproduce - they use parts of the other cells to make copies of themselves.
Certain viruses can easily reproduce inside the human body as there are lots of the right kind of cells for them to use.