Setting up unique permissions for document library folders in SharePoint
SharePoint sites allow us to create granular permissions on all its parts. This is one of SharePoint's strength as well as it's weakness; keeping track of who can see or edit an item can be confusing, so it's important to set up your groups ahead of time.
Customize SharePoint site permissions
Creating and Managing Groups in SharePoint Online
While you can share a folder or a document with any individual by typing in their email address, you cannot share these items (separately) with the sites' groups.
For clarification, if you have the folders Team-A and Team-B, and you have the site groups Team A Editors and Team B Editors, you cannot attach the Team A Editors to only the Team-A folder and the Team B Editors to only the Team-B folder. You can't connect your site's groups with folders in the same document library. You can, however, share the folders with different individuals (by their email), but this can be time-consuming and you can lose track of who can access which folder.
Rather than creating folders with unique permissions (that don't work with your site's groups anyway), you can create separate document libraries (that act like separate folders) and then connect your groups to them.