SharePoint allows people to collaborate within the organization and also externally provides they are given permissions to do so.
The SharePoint Online Admin can enable external sharing in the tenancy level as well as in the site collection level. The settings configured in the tenancy level override what is configured in the site collection level. And the settings configured in the site collection level depend on the settings at the tenancy level. For example if the tenancy level is configured to have no external sharing then the site collections would not have external sharing enabled.