Most bacteria cannot survive the high temperatures of boiling water and when you boil water and foods in the boiling water most bacteria is killed off.
However the bacteria of botulism can usually survive the boiling water temperatures for at least 20 minutes but even then boiling the bacteria will eventually kill it off.
This is why when water contains bacteria you're supposed to boil the water and then allow the water to cool down before you drink it.
Boiling that water helps kill off any potential bacteria that could be present in the water that could make you sick.
Boiling the water makes the water safer to drink than not boiling it.
However I have drank water directly out of a creek before as a kid and still do today when camping and never have gotten sick.
All types of bacteria will eventually die of the high boiling water temperatures if you boil the water long enough because no bacteria can survive the boiling temperatures forever.