What a password-protected PDF really stores
An encrypted PDF keeps an /Encrypt dictionary in its trailer describing how the file was protected: /Filter /Standard for the ordinary password case, a 40, 128 or 256-bit key, and a revision number saying which rules were used - 2 and 3 for RC4, 4 for AES-128, 6 for AES-256. Two keys are derived from the two passwords, and every string and stream is encrypted with a key built from them.
That is why knowing the password is all it takes. There is nothing to break and no brute force involved: the file carries everything needed to recompute the key, and the password is the missing ingredient. It is also why the tool cannot help with a file whose password you do not have, and why a certificate-protected file is refused outright - there the key is not derived from a password at all, so no password would work.
The copy that comes out has no encryption left in it, which is the only honest meaning of unlocked: the restrictions an owner password carried - no printing, no copying, no editing - go away with it, because a PDF without encryption has nowhere to keep them.