Why is the System Preferences Dock icon showing a Badge?
I clicked the iCloud pane, and found it was suggesting I improve my security posture.  When I did something about that, the badge went away.

I did that only after I'd tried logging out and logging in again.  I guessed restarting the computer wouldn't change anything, so I didn't try it.