As far as bacteria are concerned, other living creatures are just another niche to exploit, which means that pretty much every animal and plant has a set of bacterial pathogens that come along with it. These bacteria have made the animal in question their speciality, and are highly adapted to live inside their hosts. While these bacteria often make the host ill, or less fit, or sometimes dead, the longer they live with their host, overall, the less they damage it. After all, it’s no help to the bacteria if their home drops down dead right after they’ve moved in.
A great example of this is the bacteria Wolbachia, which infect insects and other arthropods and causes them to stop producing male offspring (so only female survive to pass on the bacterial genome). As well as passing from females onto their offspring, Wolbachia can also be transmitted horizontally, that is between insects in the same generation. In its normal host the Wolbachia is not hugely damaging (apart from removing all males from the population) but when transmitted to a new species it causes various unpleasant nervous system complications, often leading to death. It turns out, the reason Wolbachia are more dangerous in new species isn’t because the bacteria go wild in the unexplored territory, rather it’s because the new host doesn’t know how to deal with them.
As the bacteria are found inside cells, the best way for an insect immune system to get rid of them, is by destroying the cells that house the bacteria. Which, as previously mentioned, are mainly the gonads and the central nervous system. When the Wolbachia get into a new species, the first response of the insect is to quickly and efficiently destroy any cells which have bacteria inside them. As a consequence the unfortunate insect basically destroys its own brain, leading to various unpleasant symptoms and death.