The difference is the color bit depth of the 2 file types.
All digital cameras start with a Raw image data file that has either a 12-bit or a 14-bit color depth. A Raw file is not actually a photograph. The Raw data file has to be be converted (demosaiced) outside the camera to be seen as a photograph. A Raw image data file cannot be displayed on the camera's rear LCD. the convertd Raw dtat file then his a 16-bit file, though only 12 or 14 bits are actual image data. The extra 2 or 4 bits are used for parametic editing line commands and other metadata.
To convert that Raw image data into a JPEG (Joint Photographic Experts Group) file, most of the color data the image sensor recorded has to be discarded because JPEG is an 8-bit color depth file type. That's why JPEG is called a 'lossy' file tye. About 80% of the priginal color data is tossed in the bit bucket.
JPEG is also a 'compresed' file type. The compression is achieved by converting the original pixels into Minimum Coded Units (MCU's) of 64 pixels, 128, pixels or 256 pixels. In addition, based on software programming written by the camera software engineers, various image editing is done in the camera to things like saturation, sharpening, and contrast. All of that editing is done globally to each image, though the camera owner can make some very crude adjustments in the camera menus to the amount of editing done.
In short, JPEGs have little if any editing headroom outside the camera and little editinfg control in the camera. The JPEG file type was indeed designed to be a finaL, ready to print file type.