A Mac with iCloud enabled stores the keychain in your encrypted cloud account. Passwords are stored in a local encrypted database if you don’t have the iCloud Keychain.