A RAW file is a file containing all of the information recorded by your camera’s sensor during exposure. In contrast, JPG is a file that is being compressed by your camera so it doesn’t have all of the information recorded by your cameras sensor. RAW files are very high quality. RAW also takes longer to take a picture and takes up more memory.
RAW file format has more flexibility so things can be undone. While on JPG it cannot. With RAW you have full control over everything while in JPG you don’t. With JPG, a white balance is applied by the camera.