Security domains in SXA Storefront
When you create a site with SXA, you can configure the name of the security domain for the site in the Content Editor on the /sitecore/content/[your tenant]/[your storefront]/Settings/Site Grouping/[your storefront]
item:

If you select the Commerce Foundation module when you create a tenant, and then you select the Commerce Storefront Components module when you create a site, then the Create a site wizard creates and configures a domain with the same name as the site, when it creates the site.
If you change the domain on a site that already has customer accounts, the customers will lose access to the site unless you update the domain on the accounts.
Sitecore Commerce Connect defines the Sitecore.Commerce.Providers.iDomainProvider
interface. SXA Storefront includes an implementation of this provider interface in the SXA Storefront foundation layer. The domain provider returns the name of the security domain that is in use to Commerce Connect and Commerce Connect passes the domain name to the external commerce system on each API call.