One country in different markets

As far as I remember, previously a region (country) could belong to only one market. If you added it to another market, it would disappear from the first one.

Now it seems I can easily configure two markets that both include the same country. For example:

  • Market 1 - Germany, Poland

  • Market 2 - Poland, Czechia

Let’s say I have one URL for all markets, one language, and the “Use local currencies” option enabled in all of them (but possibly different catalogs).
I’m buying a product from a German IP, then I switch the shipping address to a Polish address.

Question: By what selection logic/precedence does Shopify decide which Market will be used and appear in Functions as localization.market.id (Cart Transform / Validation)? What signals matter most (domain mapping, explicit market selection, geo/IP, shipping country, catalog eligibility, Market priority/order, etc.)?