JPEG, named after the Joint Photographic Experts Group, which created the format, is a lossy compressed format well-suited to photographic images. Line drawings do better with non-lossy compressed bitmaps such as GIF and PNG.
Properly speaking, JPEG refers to an encoding rather than a file format. JFIF (JPEG File Interchange Format) further specifies the particular subset of the JPEG standard intended to be used for standardized image files, skipping some of the advanced features of JPEG intended for specific application use. What are commonly called JPEG files are almost always JFIF files. The SPIFF file format was intended as a replacement for JFIF but never caught on widely.