A trial balance compares the total debit balances with the total credit balances of all accounts in the ledger to detect errors in the ledger balances. However, it will not detect errors where transactions have been completely omitted from the ledger.