Login Screen source code
Authentication is implemented using PAM, the Pluggable Authentication Modules.
Linux-PAM is a system of libraries that handle the authentication tasks of applications (services) on the system. The library provides a stable general interface (Application Programming Interface - API) that privilege granting programs (such as login(1) and su(1)) defer to to perform standard authentication tasks.
The configuration for the login service is in /etc/pam.d/login
.
It's well-commented, and very informative.
It is PAM's modules that access to the password file, when needed. In systems with centralized authentication (for example LDAP), the login service may never need to access the password file.
See more info in man 7 pam
.