The Universal Postal Union rules for how international mail is paid for were established at a time when most mail was letters, and most letters would need a reply by letter.
So on average, every international letter delivered in Country X behalf of the Country Y postal service would be balanced by one letter delivered in Country Y on behalf of the Country X postal service.
No exchange of money between countries needed, and if a country had daily/weekly mail delivery or dense/sparse population or expensive/cheap postal employees or rich/poor citizens or tax/subsidy on post or efficient/inefficient processing that was no other country's business, so long as the number of letters balanced.
In the modern age, the number of letters doesn't balance, because no-one places their AliExpress order by mail.