Apart from the answer Shaggy D gave, that it doesn't overwrite anything unless specifically instructed, just merges the two "branches" of the library (including pointing out and creating separate files in instances of for example notes that have been modified on both locations creating a conflict) sync is also when the phone contents that aren't part of the iTunes library get backed up, if you're backing up to a computer instead of iCloud. So for example your sms convos, preference files etc.
That part of it is indeed a one-way process, from phone to computer. The reverse is when you click "restore from backup".
A thing to note is that if you want your backup to truly mirror your device you need to turn on encryption or it will skip some sensitive data, health and such.
Everything about this is also rather muddled these days as you can choose to backup to iCloud instead of computer, and most probably have their contacts, notes etc already mirrored through either iCloud or their Google/Exchange accounts - that stuff obviously isn't touched in the sync as it's already in the cloud.
A last tip about the library - generally it will transfer App Store purchases made on the phone to the computer, which can take up a lot of space and the files are of no use to the computer. Still, if they're not on the computer they won't be put back on the device in the event of a restore. If in need of space on your main drive definitely either move your entire iTunes library to a different drive, or symlink the Mobile Applications folder and move the .ipa files, works perfectly well.