This program is part of Netpbm(1).
pamtopam simply copies a PAM image from Standard Input to Standard Output. This may seem an unnecessary duplication of cat, but remember that a PAM program can read a PBM, PGM, or PPM image as if it were PAM. So pamtopam can read either a PBM, PGM, PPM, or PAM image and produce a PAM image as output.
Even that is of limited usefulness because of the fact that almost any program to which you would feed the resulting PAM image could also just take the original image directly. However, sometimes you really want a true PAM image.
You can do a more general job of translating PAM/PNM to PAM with pamchannel.