Both, Aperture and Lightroom work in the same way in that respect: they have a database (SQlite in case of Aperture) that stores meta data about the image. They never, ever make changes to the original file (overwrite it), all changes are just `recorded' and reapplied every time you look at the image. Changes are just metadata, e. g. if you crop an image, the information of the crop is stored (which is a lot, lot smaller) and the original file is never altered. Here, it doesn't matter whether the original is a jpg or a RAW file. Hence, it's easy to create a `version' of your file: Aperture or Lightroom simply create another metadata file with the different settings applied to that particular image.
Regarding RAWs, the only difference to the above is that both apps contain a RAW processor of their own (which is different from the one supplied by your camera's manufacturer). Adobe uses the same RAW engine it also uses in Photoshop. Be aware that in order to have compatibility, Photoshop needs to have the same version of the RAW processor (or newer perhaps). Apple also uses its own RAW engine. Since RAWs contain more information than jpgs (e. g. 12/14 bit vs. 8 bit), you have more headroom for edits.
Regarding lossless roundtripping to Photoshop, you need to have compatible versions of the RAW engine in both apps, otherwise this will not work and a tiff/psd file is created instead. If your initial file is a jpg, Lightroom will create a tiff/psd file instead.