File Formats explained
This little 6 min. YouTube video does a great job of explaining the difference between these two formats. These are the two most common formats that are available on Digital cameras. The third type TIFF is sometimes offered.
JPEG or JPG are formats that compress the date to create a file that is smaller. It is called a Lossy format meaning each time you open up a file and manipulate and again save it you will be losing some data. Do it enough and the image becomes noticeable degraded. RAW and TIFF are Lossless formats and do not suffer from this degradation process. Each brand of camera saves to JPG with different tweaks to the image which takes away your ability to modify it the way you like.
RAW gives you all the information collected by by the camera's sensor and leaves it to you , if you wish , to tweak it to your liking. Then when you have the image looking the way you like it you then export to one of the standard formats like JPG, TIFF, PNG. The RAW file is not changed i.e it's a non-destructive process so you can always go back to that same RAW file and change/export without worrying that you've done something to that file.
TIFF format also yields larger file sizes than JPG but is a Lossless format. No matter how many times you open-manipulate-save you won't degrade the file. You will have to ensure that your photo editing software saves the TIFF in a non-destructive manner. Most of major software offerings do this and is pretty much a requirement in today's market.