The different image file formats were invented at different times, to address needs of the day.
In some cases, the need of the day was to produce a patent-free program (e.g., GIF files were widely used for a time, until Compuserve suddenly decided to charge patent royalties.)
In some cases, the need of the day was to allow for larger images than an earlier successful format.
JPEG files implemented a clever compression scheme that reduced visible artifacts nicely for "scene" files.
But JPEG has trouble with sharp edges, and JPEG compression is lossy, so a new scheme with good lossless compression had to be invented for people doing image editing. Image editing also often requires multiple sub-images per file in order to support "layers" during composition, and for performance it was also useful to group the data for image blocks together (think the days of much smaller memory and slower disks) so that someone could concentrate on a section of the overall image without having to read the entire image in to memory. Hence the TIFF format.