Coca Cola (etc.) has 2.37-3.10pH, and the acidity is from phosphoric acid.
https://www.foodchamps.org/is-coca-cola-acidic/
"Due to their high sugar and acid content, over-consumption of these drinks is bad for your health and can aggravate symptoms of acid reflux."
"It can also cause bones and tooth enamel to erode, creating the perfect conditions for the development of cavities."
Obviously they don't put it in to destroy your teeth, and despite what the other replier said, it _does_ matter why, which is _why_ they went through the effort of wrongly attributing why it's done
p.s., phosphoric acid is delicious, that's why people like products with it in it. Back in the days of soda fountains, they'd add it in! Now it's mixed into cocktails, sometimes with various other acids (citric, tartaric, etc)