I have noticed this primarily when the email server are down, however I know what you mean (have been there)
when I configured my Imac to use cloud for my account on initial start up of the account - my password defualts to "spaces" and my server is icloud......if i attempt to enter a password into mail account preferences (mail does not appreciate it as a matter of fact mail gets mad and hangs up from time to time) so I am assuming that there is an authentication link somewhere between the password (cloud and mbp/imac and mail) so it cant be over-ridden destroying the cloud relationship or sign on authentications.
I beleive that at times, a link in this relationship is down or a set of servers are down - causing us to use another set or a different pathway..... and we need to enter the password for the mail,
but I beleive its a communications link (internet, mail servers) not being able to connect properly and the password not existing in the keychain
I will have a look if such "broken communications links" might be the problem. It would at least explain why the MBP is more affected that the iMac. However, my MPB is at quite some times offline when I travel. But it might be that the "pwd loss" is connected to re-boot or re-start of Mail.app while a functional internet connection is lacking.
Sounds this speculation correct for the experts?
very possible, the issue is as you noted..... the password exists (at times no, issues) at other times issues (requring its entry) and a logical sequence of events - boot - Internet connection - Servers - cloud - mail start up
- authentication - password location (cloud/keychain) are not being completed successfully requiring manual intervention.
hense the term communications or software interface link, I have spoken with apple in the past on this subject
(deleting/re-adding email accounts) and as going as far as building a secondary account on my mac to test if it is a user email account issue to test out the sigin (userid/password combination - authentications) to the mail servers and it turns out to be a non issue later in the day.
the only thing I have done, is make sure my macs are upto date on software,
have built my accounts using the cloud on start up (adding an account the first time as a new admin)
instead of skipping that step and adding the cloud connectivity or sign on after I have set up my desktop
since following this path all has been good and yes this speculation is for the engineers/archietects and experts