Sudden reboot and install screen on login I just logged in to my MacBook Pro (2015) running Catalina.
While entering my password my desktop background disappeared, leaving a white background.
On pressing enter, the machine suddenly rebooted.
During the phase with the white loading bar and Apple logo on a black background the loading bar filled up (rather slowly) twice, and then showed an installation dialog:

The text says:

Installing on “Macintosh HD
[loading bar]
27 minutes remaining

It didn’t say what was being installed. It didn’t remotely take 27 minutes.
After that it booted up again, with a very slow loading bar this time, slow enough for it to show a time estimate at around 8 minutes. I have to add that booting has always been lightning fast until today.
Just I logged in normally again, all my files still seem to be there, even my Safari tabs were restored.
I was hoping someone could tell me what happened (what was installed and why) and if there’s anything I should do or check now.
The simple explanation is a macOS installer was in your Applications folder (or elsewhere) and was run. 30 minutes to install isn’t out of line - especially on a machine with a bit of history or third party apps.

The logical place where running an installer happens is when you enroll / allow automatic updates in System Preferences and then in the Notification Center where options like restart now or update later are presented.
What next? Perhaps look in /var/log/install.log to see if you agree with the recent actions logged. Possibly boot to recovery and install a good clean download of the latest macOS on top of your install if you feel you can’t trace why the installer ran. Make a backup for sure, if your mac is compromised - an erase install and selective restore from backup might be needed. To me, there are very common reasons for this to happen and no particular signs you have any issues unless you can not determine why the installer ran via defaults or someone opening it manually.