I'm not sure I'm the best person to answer this, but I'll give it a shot. My understanding is that passkeys generate a unique public/private key pair for each user, device, and website combination. The website's URL is stored as part of the passkey. The browser matches the passkey's URL to the website's URL used in its TLS certificate.
Traditional passwords and TOTP codes don't have a protocol to associate a password or code with a specific website. It's up to the user to know when to enter the right password or code on the right site. That's why phishing and MITM work so well, because the user can be tricked into entering a password or code on the wrong site.
Verification usually only works one way, because the server is the only side that has a public/private key pair for TLS. The client browser can verify the authenticity of the server, but the server can't verify the authenticity of the browser. The server just has to trust that the password or code is being sent from a valid client and not a MITM.
Technically most browsers do support client certificates, which a web server could use to verify a browser. In practice very few sites use client certificates, because they're difficult to setup and maintain on the clients. They tend to a require a centralized certificate authority that everyone has to agree to trust.
Passkeys get around this by generating a unique key pair for every user of every website, instead of a single client certificate that multiple sites need to agree to trust. Passkeys give up some centralized control, and they require more storage, but they should be easier to implement than client certificates combined with user passwords.