When you synchronize, your iPhone matches the content with what is stored in iTunes. For example Contacts, Calendar, Pictures, Music and Movies.
Source, Apple Support:
You can only sync your device with one iTunes library at a time. If you see a message that your device is synced with another iTunes library, your device was previously connected to another computer. If you click "Erase and Sync" in that message, all content of the selected type on your device will be erased and replaced with content from this computer.
You can find more information here:
Use iTunes to sync your iPhone, iPad, or iPod with your computer - Apple Support