Pluggable Authentication Modules (PAM) is a framework used for authentication. Typically, most Linux distros come with PAM installed by default. PAM can be powerful if used well and it’s important to understand how PAM works. PAM has its criticisms, but is quite adequate for most purposes.
Refer this LINUX FORMAT article for a good introduction to PAM.
For easy reference, I’ve stitched together an image of important PAM concepts (shown below) taken from the LINUX FORMAT article.