Hi Rachael Cooper:
Based on your description, we understand that you want to know why you occasionally get sent an Account Verification Code when I share a document/site etc. on SharePoint/OneDrive.
It depends on the type of recipient:
Recipients who provide a verification code
When users share files or folders, recipients will be asked to enter a verification code if they have:
- A work or school account in Azure AD from another organization
- An email address that is not a Microsoft account or a work or school account in Azure AD.
If the recipient has a work or school account, they only need to enter the code the first time. Then they will be added as a guest and can sign in with their organization's username and password.
If the recipient does not have a work or school account, they need to use a code each time they access the file or folder, and they are not added to your directory.
Recipients who do not need to authenticate.
Anyone with the link (inside or outside your organization) can access files and folders without having to sign in or provide a code. These links can be freely passed around and are valid until the link is deleted or expires (if you have set an expiration date). You cannot verify the identity of the people using these links, but their IP address is recorded in audit logs when they access or edit shared content.
People who access files and folders through "Anyone" links are not added to your organization's directory, and you can't assign them licenses. They also cannot access sites using an "Anyone" link. They can only view or edit the specific file or folder for which they have an "Anyone" link.
More information for you to reference:External sharing overview - SharePoint in Microsoft 365 | Microsoft Docs
Hope this will help you.
Tin