What guarantees that for every credit there is a debit in an electronic fund transfer? I'm worried about the difference between seeming honest and actually being honest.  I know banks rely in part on a good reputation to stay in business.  But it seems to me that as long as a bank has a plausible argument that they acted in good faith, they are free (and perhaps indeed it might be greatly in their interest) behind the scenes to be arbitrarily dishonest.
Double-entry bookkeeping guarantees that for every credit there is a debit.

It's not really different for a bank than for you or I.

I can claim that I've got an account with myself for 10 squillion pounds, but everyone will ignore me. The only balances that matter are the physical currency that I hold, and the accounts I have with other people or institutions; e.g. my bank account.

It's the same for a bank: the balances that matter are the physical currency that it holds, and its accounts with other people and institutions. Predominantly, other banks, including Central Banks.

Clearing Houses are institutions, or groups of institutions, that act as intermediaries to ensure that when one bank has a bunch of transactions with another, the net balance is transferred correctly while minimising counterparty risk. And the Central Bank offers a settlement service: for example, banks with sterling deposits will (typically) have an account with the Bank of England, which carries out settlement between banks.