Removing Rust with Coke
Rust is a hydrated iron oxide that has a volume greater than the iron it contains. When iron rusts, the oxide grows in layers and curls away from the iron, exposing it to more corrosion.

Phosphoric acid is a moderately strong acid, but it forms an iron phosphate that is insoluble but adherent to iron (and steel). In that sense, phosphoric acid deactivates corrosion on iron (not perfectly, but pretty good), and there are commercial products (like Naval Jelly) which are essentially gelled phosphoric acid, designed to rub on iron and steel to give some corrosion protection. It is a sort of passivation.

Phosphate ions adhere to rust, making rust particles negative and promoting dispersion in the liquid and disadhesion from the iron metal. Some elbow grease is generally needed.

Overall, the extra corrosion from Coke or other phosphoric acid is minimal, and the dispersive effect is helpful, and the iron is better protected after the treatment than before.