This can be set in multiple places, these are the most common:
- There is an organization level setting (Sharepoint Admin center, Policies, Sharing)

- There is a sharepoint teams site specific policy. (Sharepoint admin, Active Sites, click on the site, click on policies tab for the site, edit external sharing)

Once you click on More Sharing settings, should take you into
