Reused passwords are how most accounts are lost. A password manager fixes that, and passkeys remove the password altogether where they are supported.
When one site is breached, attackers try the leaked email and password on every other site. If you reuse passwords, one breach opens many accounts.
It generates a long random password for each site, stores them encrypted, and fills them in for you. You remember one strong master password. An overview is in Wikipedia's article on password managers.
A passkey replaces the password with a cryptographic key pair. The private key stays on your device and is unlocked with a fingerprint, face or PIN. Because the key is tied to the genuine site's address, a fake login page cannot use it. Where a service offers passkeys, they are worth enabling.
A password manager fills credentials only on the address it saved them for. If it refuses to fill on a page that looks right, check the address bar: the page may be an imitation. More on that in spotting a cloned website.