If the file has properties not supported in the jpeg format specification, Photoshop will save out a copy. The original file is still open, and so you get a prompt to save that, with all the data intact.
This is the way it has to be. A few versions back, PS wouldn't even save out a jpeg at all, until the file complied completely with the jpeg specification (no layers, masks, 16 bit depth and so on).