Why is sites i18n often based on the users country and not the preferred language in the browser?

Often when I visit corporate websites they obviously have i18n. Often the chosen language they will display is based on the country I am in, NOT what I have set as preferred language in my browser.

I'm from Sweden, live in China, and often use a VPN to Japan. The displayed language of dell.com and ebay.com is Japanese if I use a VPN in Japan, and Chinese if I don't use a VPN. My preferred language is English first, then Chinese, then Swedish.

I'm a data scientist and software engineer and have done multiple web projects using different frameworks, and everytime the standard way of doing i18n is with gettext and .po/.mo files, and the language chosen is 100% based on the preferred language list provided by the browser.

How can it be good user experience to show me Japanese text on a site just because I happen to currently be in Japan, even though I've stated I want to see sites in English? I'm having a hard time seeing what the possible reason can be for this choice; but obviously there are arguments for doing it this way since so many multinationals choose to do it this way, but I have never heard or realized what it could be.

Please enlighten me. :)

EDIT: Also, often when I manage to find the dropdown to change the language, they tell me to choose a country, not a language (e.g. paypal.com). It far from obvious if I should choose the country I'm born in, the country I live in, or a country who's language I wish to see the site it. The best experience I have ever seen is att offgamers.com, where I can choose to see the Chinese market (where I live), with prices displayed in Swedish Crowns (since I have a Swedish mastercard), and the language used as English (because it's what I'm used to).