This will happen when you sign in to any Microsoft product, such as Office, Teams or Onedrive. After you input email and password, there is a window dialog with a big button to use that credential to manage the device, i.e., your computer, converting your local into an online account. And there is an option, with small text, to "use only in Microsoft applications", or words to that effect. This is easy to get caught, as everybody won't read dialog windows and rapidly click on whatever big button.