It is possible that your iPhone is forgetting passwords for certain websites if you have enabled the "Clear History and Website Data" option in the Safari settings. This option will erase all browsing history, cookies, and other website data from your device. If you have enabled this option, it could be causing your iPhone to forget the passwords for certain websites.
If this does not resolve the issue, there may be other factors that could be causing your iPhone to forget passwords. For example, if you are using multiple browsers or have multiple accounts signed in on the same device, this could cause confusion and result in your iPhone forgetting passwords. You may want to try signing out of all accounts and using a single browser to see if this helps.
If the issue persists, you may want to try resetting your iPhone's settings. This will not delete any of your data, but it will reset all of your settings to their default values. To reset your settings, go to Settings > General > Reset > Reset All Settings.
If you have tried all of the above steps and your iPhone is still forgetting passwords, there may be an issue with the hardware of your device. In this case, you may need to bring your device to an Apple store or authorized service provider for further assistance.