Currently I am reading and testing code about Client Authentication, but I find that there are two progresses forked if I login using psql, while only one progress is forked if using pgAdmin.
If psql finds the server asks for a password, it closes the first connection, displays a password prompt to the user, and then does another connection attempt with the password the user entered. You can avoid the first attempt with the -W flag; though there's usually no reason to do that in practice.