How are the gallery application edits applied to images?
You can find the source for this app in the Gallery2 package in AOSP. All the code for the photo editor is in src/com/android/gallery3d/filtershow. The saving is handled by tools/ImageSave.java, which has this comment explaining the behaviour (which I've formatted):-


  In order to support the new edit-save behavior such that user won't see the edited image together with the original image, we are adding a new auxiliary directory for the edited image. Basically, the original image will be hidden in that directory after edit and user will see the edited image only.
  
  Note that deletion on the edited image will also cause the deletion of the original image under auxiliary directory.
  
  There are several situations we need to consider:
  
  
  User edit local image local01.jpg. A local02.jpg will be created in the same directory, and original image will be moved to auxiliary directory as ./.aux/local02.jpg. 
  If user edit the local02.jpg, local03.jpg will be created in the local directory and ./.aux/local02.jpg will be renamed to ./.aux/local03.jpg
  User edit remote image remote01.jpg from picassa or other server. remoteSavedLocal01.jpg will be saved under proper local directory. In remoteSavedLocal01.jpg, there will be a reference pointing to the remote01.jpg. There will be no local copy of remote01.jpg. If user edit remoteSavedLocal01.jpg, then a new remoteSavedLocal02.jpg will be generated and still pointing to the remote01.jpg
  User delete any local image local.jpg. Since the filenames are kept consistent in auxiliary directory, every time a local.jpg get deleted, the files in auxiliary directory whose names starting with "local." will be deleted. This pattern will facilitate the multiple images deletion in the auxiliary directory.
  


In short: yes, it saves edited images in a .aux directory, inside the directory the image came from.

It also stores the filter chain you used to create the image in XMP metadata inside the new image (the filtered one), in the namespace http://ns.google.com/photos/1.0/filter/. This information consists of:


SourceFileUri: the URI where it has saved the unmodified file
filterstack: a serialized representation of the stack of filters it used (in the same format it saves presets to its private database)