Depends on the payment.
If both the payment parties are in the same country, it can be settled by a cheque even. The cheque would probably go into the RTGS and get cleared. Not a big deal. If it is in Billions… some bank on one ledger has the money and it is a ledger transfer. To ensure the safety of the transfer, protocol is put into place to double-verify and authenticate the balance transfer.
For multiple countries, same rule pretty much. Ledger entries are changed.
Here are two examples you can read up on:
- Faisal Khan's answer to Where are countries' bank accounts held?
- Faisal Khan's answer to How do countries pay debts of millions? Is the money moved physically or electronically?