Bacteria must be invasive in order to cause disease. Without the ability to invade their host, they would remain on membranes and barriers (skin, mucous membranes, …). The inability to enter the host could prevent many pathogens from functioning, as they would not be able to sequester nutrients and minerals easily from their host. It is therefore important for a pathogen to invade its host.
A bacteria’s invasiveness is determined by the virulence factors it has encoded within its genome, and the transcriptional activity of these factors. Adhesins are important in the first instance of infection, ensuring the pathogen is not going to be washed off the surface it has reached. Invasin proteins are then used to lyse the surrounding host cells.
A pathogen that is able to cause more damage to its host would be deemed more pathogenic than one with fewer virulence factors.
If a pathogen causes too much damage to its host, too quickly, it may cause the death of the host before the pathogen has the opportunity to spread to a new, susceptible host. This premise is employed in viruses, where the more infections a virus goes through, the less virulent it becomes (in some cases, as used during serial passaging).
Damage to the host can be caused by toxins. Endotoxins and exotoxins are common. A notable example is Clostridium tetani, which produces the tetanus toxin. It is possible to produce toxoid vaccines (and one is available for tetanus).
It is also possible to cause damage by evading host defences. A bacteria may be able to turn off expression of antigenic proteins with phase variation, preventing the activation of the immune system.