This is a lossy compression technique. Each time an image is loaded and saved in JPEG format, some detail is lost. Load and save a JPEG image too many times and the result is an angular and blotchy image. However, it is the most well known and useful of the photographic image formats and the format of choice for sending photographs by email. PNG is a multipurpose image format whose purpose was to take the best of GIF and JPEG and combine them into one format so that it would be easier to guarantee that an image can be read by its recipient instead of having to make them figure out which image viewer to use.
Various mode switches inside the image inform the viewer program which of the sub-formats to decode.
The main reason that PNG hasn't caught on more is because the first web browsers chose to use GIF and JPEG instead. PNG was too new at that time to be given serious consideration. However, many email programs can directly show PNG or have viewer add-ins that make it easy to show. The image creator decides at save time whether to use lossy or lossless compression and variants of each. The parameter choices are slightly different from GIF or JPEG, but the nature of the choices is the same.