To render a password unreadable or unusable to hackers, it is converted into a different code using password encryption, which cannot be read without the original key. An encryption algorithm (e.g., AES or RSA) converts a plaintext password into an encrypted version (ciphertext). Since the process is reversible, the ciphertext can be converted back into the original plaintext with the correct key. Unfortunately, this also allows hackers to recover encrypted passwords.
Password encryption should therefore only be used when data is being transmitted to a recipient who is supposed to see the plaintext. An example of this would be end-to-end encryption (E2EE) for messaging apps such as WhatsApp.
Passwords, on the other hand, should not be encrypted using password encryption, but rather obscured using password hashing.