And this is what I mean by not understanding the Application you're trying to use:
If you edit RAW files in Photoshop it stores the changes alongside the RAW in the same filesystem folder.
If you process a Raw with ACR (and it's with ACR and not Photoshop) the result is saved in a new file. So you have Photo.Raw and Photo.jpeg.
Iphoto in contrast stores the changes in the iphoto library even if the master is elsewhere. I
When you process a Raw with iPhoto (or with Aperture or Lightroom) there is no new file created. Your decisions are stored in an SQL database and applied to the Master (or Raw) file every time you view it. Again: There is no new file created. That's why you can edit and re-edit and re-edit to your heart's content. Each time the new decisions are applied in aggregate to the Original or Master and stored in the database.
That's lossless processing.
iPhoto (and Aperture, Lightroom etc) are not editors. Simply: you cannot edit a file with any of these apps. Open a Jpeg in Photoshop. Crop it. Save it. The original Jpeg is overwritten. That's an editor.
Open the same file in iPhoto (et al) Crop it. The Original Jpeg is... untouched. The instruction to crop is stored in the database. View the shot and you see it with the crop. Crop it again, enhance it and so on. All these decisions are stored in the database.
The file is untouched but the Photo is edited
That's the key distinction.
Okay so now you have a file, a photo and a lot of decisions about it, stored in a database. What if you want to do something with it - Email it, use it in a Website or a Word document - how do I get it there?
Strictly speaking you would export it from the database. Note this process makes a new file containing the decisions you've made about the photo. So it's a new file containing the cropped image. It's not a recompression of the original file. It's not the original file edited. It's a whole new file with the cropped image in it. (That's why you can actually export a larger sized Jpeg than the one you imported, odd though that may seem.)
If you export you have various options: you can export as Jepg, Tiff, png. In Jpeg you can export at various qualities (levels of compression) and sizes (in dimensions). You can write the metadata to the files on export (when the format supports that) and so on.
End result: Your original file untouched. Your edits stored in the database with unlimited options to re-edit, restore and so on. And the ability to export that Photo into a variety of formats and sizes depending on the use you have for it.
Note the Preview is a special case. And I suspect that this is what you refer to when you say
Iphoto in contrast stores the changes in the iphoto library even if the master is elsewhere. I
With iPhoto as you edit (and re-edit) a Preview is created automatically. (If you re-edit the existing preview is destroyed and a new one created. The Preview is not edited, note, it's re-created to reflect the changes you've been making to the Photo). What's that about? It's a handy shortcut. Rather than forcing you to export tediously every time you want to email a shot to grandma it makes a handy version, middle quality everything that's fine for most common uses. But this is not the "edited file", just a shortcut to save you exporting everytime you want to use the Photo.
In Aperture (pay more get more options) you can even elect not to use Previews at all.
So, you've been exporting the Preview (Current setting) thinking it was the edited version. It's not. (You could have got better quality output by exporting using other settings.) iPhoto can't store the changes in the filesystem because there ain't any such file to store.
And that's what I mean when I say you don't understand the application.
Regards
TD