Phosphoric acid is used as an acidifying agent. Cola is a very acid drink, more acidic than well-known acid products such as lemon juice or vinegar. As cola also contains either sugar or sweeteners, we do not realise the acidity; the sweet taste masks the acid taste. Lemons contain much less sugar and thus taste more acidic. The acid is also responsible for the anti-rust effect of cola.
Why phosphoric acid is used is not clear; most recipes are still secret. Due to the acidity, micro organisms such as fungi and bacteria will not be able to grow; the acid thus also acts as a preservative. Acid is also considered a pleasant and refreshing taste. Other acids may cause the same sensation; however, the widespread use of phosphoric acid is probably due to the fact that when the drink was developed (in the 19th century) phosphoric acid was cheap and easy to obtain.