Toothpaste neutralizes acid by using its basic ingredients to react with the acids in the mouth, neutralizing the negative effect of acid on the teeth. When acidic and basic substances are combined, they react to form a more neutral salt. Depending on the strength of the acids and bases reacting, the salt may be more acidic, more basic or perfectly neutral.
Most people's mouths have residual acid on them from eating certain foods. The bacteria in the mouth that is not washed away by saliva reacts with the sugar in these foods and forms acid on the teeth. An excessive amount of acid is detrimental to teeth, as it weakens the enamel.
Enamel is the hard, protective covering on teeth made of mineral crystal. When the mineral crystal is exposed to too much acid, it begins to break down, eventually resulting in a cavity. To try and combat this, many types of toothpaste contain mild bases in their ingredients, such as sodium fluoride or sodium bicarbonate, that neutralize the acids. Foods and drinks that can cause a large build-up of acid in the mouth include soft drinks, wine, fruit and honey, whose consumption should be limited, or followed by thorough brushing of the teeth, to avoid tooth decay.