My guess is that it goes through /etc/passwd, which is a mirror of the NetInfo user database.
That said, you really shouldn't do this, unless you're using Digest authentication. Basic authentication sends passwords over the network in what amounts to cleartext (it uses Base64, which is about as strong as ROT13). Use Digest authentication if you have to use anything.