What is PBM?
One bit per pixel - black or white, nothing in between. The most minimal image format in common use, and still the right one for scanned documents, line art and anything headed into OCR or shape analysis. Photographs do not survive it.
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.