Depending on how you manage content on your iPhone, its contents may be synced with a particular computer. When connecting the iPhone to another computer with iTunes, you'll see the message "The iPhone is synced with another iTunes library" and will be given the option to erase and sync, clearing all media from the phone. You won't lose everything during this process, but the phone will lose all of the content that syncs through iTunes.
Erase and Sync
When you click "Erase and Sync" you're telling iTunes to delete all of the content from the iPhone, including music, videos, photos and applications -- all of which are managed by iTunes. This will clear all of that content off of the phone to enable you to sync it to a new iTunes library on a new computer.
If you choose "Erase and Sync" and wipe all of the content from your iPhone, some things will remain on the phone, including your contacts, messages and call logs. All of your applications will be erased, including app data.