Hm I always wondered about what this choice actually translates to, what’s the underlying logic determining how what I pay in -> where conversion gets made?
It's called DCC and you are legally required to be offered a choice. If you choose the local currency, your home bank does the exchange and the rate is basically always better. If you choose your home currency, the terminal operator does the exchange at a terrible rate and often slaps on a hefty fee for the "convenience".
To make things more complicated: it's not necessarily your home bank making the exchange, it can also be your card scheme (e.g. MasterCard/Visa/...). However, this is something you don't get a choice in. Your bank has an agreement with the scheme which foreign currencies are handled by whom. In any case, the rates used by the schemes are generally also pretty good.
The lack of direct documentation/instructions or link in the terminals to official rules strikes me as horrible ux. You basically just have to be in the know or know who to ask?
It is horrible UX and one might argue intentional. The terminals are provided by the acquirer, i.e. the same party that stands to make extra money if you let them handle the currency exchange.
In Germany, there was a sliver of time where stores essentially taped a piece of paper to terminals with instructions and big red arrows to select a specific scheme because that would benefit the store (and not cost the consumer extra). It didn't really stick, however. I suspect because it was two extra button presses and the consumer wouldn't notice either way.