this question is very very broad. there are so many ways they can cause disease that you have whole textbooks devoted to microbiological pathophysiology. but some mechanisms are:
- bacteria can secrete proteins which cause harm to cells around them. causing inflammation in the area, bring immune cells (such as natural killer cells) to get rid of the damaged cell.
- gene transfer from bacteria to human cells can cause cellular damage or even cancer. stomach ulcers are thought to possibly occur in this fashion
- the wrong bacteria in your stomach can upset the natural balance of flora (helpful bacteria) causing stomach problems
- certain molecules secreted by the bacteria can interupt cellular communication which in turn can prevent or cause the over expression of certain genes
thats just a few
hope it helps!
cheers