It depends on the bacteria! Pseudomonas aeruginosa that I work on colonises the lungs of people with respiratory diseases, then causes massive inflammation which progressively damages the lungs and causes death. Bacillus anthracis (anthrax) on the other hand actually hijacks immune cells, it forms spores which can’t be destroyed by the immune cells, then destroys them from the inside out so that all of a sudden the infection is systemic (everywhere in the body).
Bacteria vary too on whether they mean to do this; some have evolved to be very specific to a particular plant or animal and it’s an advantage to them for the host to die and the bug be passed on. Many just want to live in your body (and many do) and accidentally kill you by there being too many and overwhelming the immune system or by producing toxins which are actually intended for other bacteria.
Bacteria have been around for 3.5billion years, so when they kill us it’s because we’ve got in the way of their inter-bacteria battles which have been going on since before the dinosaurs!
Antibiotics, the best way to treat bacteria, are actually from bacteria and fungi. It’s bacteria that produce antibiotics to kill each other, scientists can rarely make molecules so complicated and effective against bacteria so use those that they produce against each other.