What is PPM?
Uncompressed RGB behind a four-line text header - about as simple as an image format can be while still being one. Nobody ships PPM to users; it exists as the thing scripts and teaching code write when they'd rather not link an image library.
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.