What is PGM?
Greyscale, uncompressed, with a header you can read in a text editor. PGM is part of the netpbm family, and it exists because sometimes you want pixel values you can do arithmetic on without a decoder in the way. Image processing and computer vision code loves it.
What is TIFF?
The format print shops, scanners and archives run on. Lossless, capable of holding several images in one file, and old enough that everything in that world reads it. Files are large, which nobody in print has ever minded.