To kill the germs that cause gum disease, and to help remove particles of food and bacteria from between the teeth. Peroxide also reacts with bad smelling molecules that are produced by bacteria, so it freshens the breath.
Brushing your teeth is good for removing the bacteria that have glued themselves to the tooth surfaces. It also reaches down into the space between the tooth and the gum, to remove some of the food and bacteria that settle there. But it is not very good at getting deep below the gum line.
Flossing helps a lot. It scrapes off the biofilm that the bacteria use to glue themselves to the teeth, and the floss can slip way down between the teeth and the gums to get where the toothbrush can’t. But flossing does not kill the germs, and it can leave many of the germs behind.
Hydrogen peroxide reacts with the catalase enzymes that the germs produce, causing it to split into water and oxygen. The bubbles of oxygen then carry the bacteria and food particles up out of the gums where they can be spit out. There is so much hydrogen peroxide in a mouthful that it overwhelms the bacteria’s ability to break it down, and the bacteria are killed.
Because the peroxide works by oxidizing the bacterial cell walls and contents, there is little that bacteria can do to develop resistance to it. This is unlike many other antibiotics, which work by targeting specific functions in the germs. The germs can evolve defenses against these more easily than they can for hydrogen peroxide.