Idiom Usage:
In some circumstances "balance the books" could mean that there is injustice or imbalance between two people or groups. Perhaps one person owes another a favor, so there is an imbalance in obligations. To balance the books, the person who owes the favor needs to do the favor in order to balance the books.
Government
When a government balances the books, it means that the government has spent the same amount of money as it has received.