When iron reacts with oxygen and water, it forms rust, and to remove it, you need to un-oxidize the iron. Oxygen has a greater affinity for aluminum, so when you rub them together, the iron loses oxygen to it, removing the rust — vinegar can also help quicken this process.