Almost all digital cameras will allow you to choose the file type that is produced when you take a picture. This decision should be one of the first made when setting up a new camera.
A JPEG/JPG is a file type that is processed by the camera which gives a usable image instantly, they’re often smaller in size and very limited in the adjustments you can make in post-processing software. Someone might choose the JPG setting if they’re confident in their exposures, need a quick image to send to someone or they don’t have any software that can process RAW files.
A RAW file is an image file that has data embedded within it. There is a greater deal of customisation and flexibility and there’s more options for correcting exposure issues. Here's a cooking analogy: a raw file contains the ingredients to make a specific meal that you can prep however you'd like, whereas a JPEG is that meal already cooked, and there is less flexibility in how you can modify it.
More information on images resolution can be found in the following article here.