Before We Start: This article is relevant to any SharePoint user who has or will be syncing SharePoint to File Explorer. Understanding SharePoint syncing limits will help prevent syncing errors.
For optimum performance, Microsoft recommends storing no more than 300,000 files in a single OneDrive or team site library. Although SharePoint Online can store 30 million documents per library, for optimum performance Microsoft recommends syncing no more than 300,000 files across all document libraries. Additionally, the same performance issues can occur if you have 300,000 items or more across all libraries you are syncing, even if you are not syncing all items in those libraries.