iCloud Keychain is a bit more complicated than say iCloud Photos or Notes. Doing the wrong thing can make you lose access to your Keychain. Did you turn off keychain on all your devices before you did the factory reset? If so, you are out of luck since that deletes it out of the cloud too. (I'm not sure if signing out of iCloud also turns this off since you have to do this when doing a factory reset.)
If you need help with iCloud Keychain, learn what to do.
support.apple.com
If not, have you've gone into iCloud settings and enabled Keychain? Since both of your devices were wiped, you should get a prompt asking for an iCloud Security Code or previous passcode from when you initially set up the keychain. Did you get this, or were you prompted to set up a new Keychain? (Entering in the code incorrectly too many times also deletes the keychain.)
With iCloud Keychain, you can keep your passwords (and other secure information) updated across your devices and shared with the people that you trust.
support.apple.com
Use iCloud Keychain on iPhone to keep website passkeys, passwords, credit card information, and other account information up to date across your other devices.
support.apple.com
If Keychain is already on, it's likely the passwords are inadvertently lost and you're using a new keychain now. If you have a local encrypted backup of your iPhone or Time Machine backup of your Mac, you could try restoring from that to see if you can recover any passwords that may have been synced/saved locally, and manually add them to your new keychain.