Vinegar is dilute acetic acid so it acts as a mild acidic cleaner in the same way as citric acid and phosphoric acid. As dsbrantjr noted, Navel Jelly is a jellied phosphoric acid so it does leave an iron phosphate residue which is a fair corrosion preventative. The phosphatizing surface treatment used by the military to protect weapons and know as "Parkerizing" is a similar process.