I have purchased a ton of music and applications directly from my iPhone. However, if my device dies, then I could potentially lose that content. Here is how to force sync the purchased content from your device back to the iTunes library on your computer.
After you purchase content on your iPhone or iTouch, this command will make sure it gets synced back to your computer.
1. Open iTunes
2. Connect the device
3. Right-click (or ctrl-click) on the iPhone or iTouch icon in the devices section in the left column of iTunes
4. Select Transfer Purchases from the menu that appears.