This is NOT exactly the way it happens but the idea of what happens
If you look at the drawing you will see that when you take a picture in JPG mode the data will go though a lot of different steps before it is written to the memory card. The camera does the same thing to each picture.
Think of going to the doctor and he gives the same medicine to everyone. No matter what is wrong with them they get the same thing. Well, that will work in a lot of cases but not all of them.
In RAW mode the camera takes the data right from the CCD and then sends it to the memory card, it adds with the file the information about how the camera was set, but it does not change the image data.
You are the doctor now, with editing software you can adjust each different image in a different way. This will get the best image you can from the raw data.
Raw file are much bigger then jpg files, they have not been compressed at all.
You cannot look at a RAW file without converting it first with software.
There are 2 files the camera makes, one is the XXXXXXX.orf and the other one is a xxxxx.thm. The ORF file is the DATA and the THM file is a thumbnail that the camera use so you can see the image.