The main trick that folks get hung up on (and, you might be too) is that most "money" is just an IOU from a bank. We've just created a sophisticated way to trade the IOUs and call it "money".
It's not inconceivable (nor magical in any way) to imagine treaties that would allow an actual conversion from one currency to another, where USD go in one side and Euro come out the other. Situations like this have existed in the past: currencies have been converted when, for example, the former currencies in the Eurozone were converted to Euros.
No such situations exist right now: entities just hold multiple currencies and exchange them for you.
Your mental model is falling down around the definition of "currency", "money" etc. It isn't what you imagine it is. We just have a system for trading bank receivables and call it "money".
It took some prompting to get it to say "It's really not rocket science." though.
https://chatgpt.com/share/67fa2c5f-d940-800a-bdad-b723e763e0...
But yeah, it's mostly just market forces that keep things stabilized, it seems.
[1]: https://www.cfr.org/tracker/central-bank-currency-swaps-trac...