In multicellular organisms it is essential that every cell behaves and does the job it was produced to perform. The survival of a multicellular organism depends on this - every cell in your body is tightly controlled in terms of how big it can grow (fairly big), when it can reproduce (almost never) and what sort of metabolic processes it may carry out. And, like a dystopian sci-fi future, any cell that steps out of line is put to death. Not by surrounding cells, but by its own internal processes.
Each cell in the human body is programmed to die. Death is their default state. It is only by behaving, by obeying outside orders and carrying out the processes it's meant to, that the cell is able to inhibit its own destruction. This is a good thing for the body as a whole, because cells that do manage to escape the tight death-regulation control are cancerous cells, and cause havoc within the body.
This makes sense for cells within a multicellular organism who, after all, have an entire body to maintain. What is less certain is why bacteria would want to have death pathways within their cells. Because strangely enough they do. In E. coli two genes, called mazE and mazF are encoded on the same bit of DNA (the same operon). MazF encodes a killer toxin, while mazE makes the antitoxin. If the mazE DNA is damaged, or the mazE protein made by the DNA is inhibited, then the mazF will be let loose and the cell will die.
Not only does this one death-pathway exist in E. coli but it interacts with another mechanism the cells have for dying. In the case of large amounts of DNA damage, the DNA repair system is mediated by a protein called RecA. A rise in the amount of messenger RNA for RecA (messenger RNA is used to make the protein from the DNA) triggers cell death in E. coli by causing the cell membrane to depolarise, breaking down cellular integrity and leading to cell death. When the mazEF system is activated it will inhibit RecA; in cells where the mazEF system has been removed higher levels of mRNA Rec A were found. And cells with both RecA and the mazEF systems removed were much less likely to die. Cells with both of the death-pathways removed were surviving longer despite damage to the DNA.
Although the mechanism is very interesting, it still leaves the big unanswered question of why the bacteria do this. What possible reason would there by for a unicellular organism to kill itself? One observation that might help to answer is that mazEF does not just inhibit RecA on its own, it also relies on a small molecule called EDF (extracellular death factor). The exciting thing about EDF is that it doesn't come from inside the bacteria, it is a quorum-sensing molecule that is produced by surrounding bacteria of the same species. This suggests a high degree of colony behaviour from the bacteria, the reason one cell dies is because the colony cannot cope with having a crazy rogue cell anymore than the inside of a human body can.
But if both pathways lead ultimately to death, what is the point of choosing between them? One suggestion is that if there are lots of bacteria around in a colony, it makes more sense to kill off any that start to go genetically screwy, and RecA doesn't just kill bacteria it also leads to certain amounts of DNA repair. If there are many bacteria around, all releasing EDF, then any cell with small amounts of DNA damage will discreetly commit suicide. If there are fewer cells around, then the RecA will do its work, and may help to produce more survivors (albeit survivors with imperfect DNA) which would be the priority if colony numbers are low.
DNA may be 'selfish', but the emergent behaviour of cells can get pretty altruistic at times!
Ref 1 (this paper has a huge discussion of all the ways bacterial cells can kill themselves):Lewis, K. (2000). Programmed Death in Bacteria Microbiology and Molecular Biology Reviews, 64 (3), 503-514 DOI: 10.1128/MMBR.64.3.503-514.2000
Ref 2: Robinson, R. (2012). In E. coli, Interrupting One Death Pathway Leads You Down Another PLoS Biology, 10 (3) DOI: 10.1371/journal.pbio.1001278