Posting stuff overseas in the mail: how does that work?

I mean, I know how it works - you stick some stamps on the envelope and sooner or later it finishes up on the far side of the world. But the stamps you buy are revenue for your national postal service. I live in Thailand. When I send a package home to my Dad in England, the Thai postal service puts it on a plane in Thailand, and it’s flown out of the country - so who’s paying for its delivery to and within the UK? The letter’s picked up at the airport and delivered by road to my Dad’s address - presumably at the expense of the British Mail Service. They’re not getting a cut of the stamp fee I paid in Thailand.

So there’s my question: how does international postal service work? Is there some kind of formal agreement countries enter into whereby they receive other countries’ mail in return for delivering their own? Or is it just an informal, unsigned. extra-legal agreement?

Huh? Huh?

Cecil on international mail:

Brian

International postal services agree to carry each other’s mail as part of national treaties.
One side will usually pay the other side a yearly cash payment as well. What you pay to send the package does not get paid directly to the destination country.

That was my understanding of how the US handles mail, your country may do things differently.

I’d done a search before posting (ha ha - see what I did there?) but it threw up nothing - search term anomalies. So thank you for this link. Everything’s as clear as mud now!